public class KeyManagerConfigurer extends org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>
KeyManager bean.
Common strategy across most internal configurers is to first give priority to a Spring Bean if present in the
Context.
So if not KeyManager bean is defined, priority goes to a custom KeyManager provided explicitly
to this configurer through the constructor. And if not provided through the constructor, a default implementation is
instantiated that is configurable through the DSL methods.
This configurer also reads the values from SAMLSSOProperties#getKeyManager() if no custom KeyManager
is provided, for some DSL methods if they are not used. In other words, the user is able to configure the KeyManager
through the following properties:
saml.sso.key-manager.public-key-pem-location
saml.sso.key-manager.private-key-der-location
saml.sso.key-manager.store-location
saml.sso.key-manager.store-pass
saml.sso.key-manager.key-passwords
saml.sso.key-manager.default-key
| Constructor and Description |
|---|
KeyManagerConfigurer() |
KeyManagerConfigurer(org.springframework.security.saml.key.KeyManager keyManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(ServiceProviderBuilder builder) |
KeyManagerConfigurer |
defaultKey(String defaultKey)
Sets the default key to use for encryption.
|
void |
init(ServiceProviderBuilder builder) |
KeyManagerConfigurer |
keyPassword(String key,
String password)
Alternative to
keyPasswords when only 1 (one) key is present in the KeyStore. |
KeyManagerConfigurer |
keyPasswords(Map<String,String> keyPasswords)
Specify the passwords of the keys stored in the
KeyStore. |
KeyManagerConfigurer |
keyStore(KeyStore keyStore)
Set the actual
KeyStore object to use. |
KeyManagerConfigurer |
privateKeyDERLocation(String privateKeyDERLocation)
If no
KeyStore is provided, specify a DER private key location. |
KeyManagerConfigurer |
publicKeyPEMLocation(String publicKeyPEMLocation)
If no
KeyStore is provided, specify a PEM certificate location. |
KeyManagerConfigurer |
storeLocation(String storeLocation)
If not
KeyStore is provided, specify the KeyStore location. |
KeyManagerConfigurer |
storePass(String storePass)
Specify the
KeyStore password. |
public KeyManagerConfigurer(org.springframework.security.saml.key.KeyManager keyManager)
public KeyManagerConfigurer()
public void init(ServiceProviderBuilder builder) throws Exception
init in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionpublic void configure(ServiceProviderBuilder builder) throws Exception
configure in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>configure in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionpublic KeyManagerConfigurer keyStore(KeyStore keyStore)
KeyStore object to use. Takes precedence over publicKeyPEMLocation(String),
privateKeyDERLocation(String), and storeLocation(String).keyStore - the KeyStore to use.public KeyManagerConfigurer publicKeyPEMLocation(String publicKeyPEMLocation)
KeyStore is provided, specify a PEM certificate location. Used in conjunction with
privateKeyDERLocation(String).
Alternatively use property:
saml.sso.key-manager.public-key-pem-location
publicKeyPEMLocation - the location of the PEM public key certificate.public KeyManagerConfigurer privateKeyDERLocation(String privateKeyDERLocation)
KeyStore is provided, specify a DER private key location. Used in conjunction with
publicKeyPEMLocation(String).
Alternatively use property:
saml.sso.key-manager.private-key-der-location
privateKeyDERLocation - the location of the DER private key.public KeyManagerConfigurer storeLocation(String storeLocation)
KeyStore is provided, specify the KeyStore location. Takes precedence over publicKeyPEMLocation(String) and
privateKeyDERLocation(String).
Alternatively use property:
saml.sso.key-manager.store-location
storeLocation - the location of the KeyStore.public KeyManagerConfigurer storePass(String storePass)
KeyStore password. Not relevant if using publicKeyPEMLocation(String) and
privateKeyDERLocation(String).
Alternatively use property:
saml.sso.key-manager.store-pass
storePass - the KeyStore password.public KeyManagerConfigurer keyPasswords(Map<String,String> keyPasswords)
KeyStore. Not relevant if using publicKeyPEMLocation(String) and
privateKeyDERLocation(String).
Alternatively use property:
saml.sso.key-manager.key-passwords
keyPasswords - public KeyManagerConfigurer keyPassword(String key, String password)
keyPasswords when only 1 (one) key is present in the KeyStore.
Alternatively use property:
saml.sso.key-manager.key-passwords
key - the key name.password - the key password.public KeyManagerConfigurer defaultKey(String defaultKey)
publicKeyPEMLocation(String) and
privateKeyDERLocation(String).
Alternatively use property:
saml.sso.key-manager.default-key
defaultKey - the default key name.Copyright © 2018. All rights reserved.