Class PKCS11PrivateKeyFactoryBean
java.lang.Object
net.shibboleth.shared.spring.security.factory.PKCS11PrivateKeyFactoryBean
- All Implemented Interfaces:
FactoryBean<PrivateKey>
Spring bean factory for extracting a
PrivateKey from a PKCS#11 keystore.
This relies on the SunPKCS11 provider.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PrivateKeyThe singleton instance of the private key produced by this factory.private StringAlias for the private key.private StringPassword for the private key.private final org.slf4j.LoggerClass logger.private StringPKCS#11 provider parameter string.private static ProviderSingletonProviderfor all instances of this factory.private static final StringThe name for the base PKCS#11 provider.Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the key alias in use.Gets the key password in use.private KeyStoreClass<?>Returns the PKCS#11 configuration.private ProviderGets the singleton PKCS#11Provider.booleanvoidsetKeyAlias(String alias) Sets the key alias to use.voidsetKeyPassword(String password) Set the key password to use.voidsetPkcs11Config(String config) Sets the PKCS#11 configuration to use.
-
Field Details
-
UNCONFIGURED_PROVIDER_NAME
The name for the base PKCS#11 provider.- See Also:
-
provider
SingletonProviderfor all instances of this factory. -
log
@Nonnull private final org.slf4j.Logger logClass logger. -
pkcs11Config
PKCS#11 provider parameter string. -
keyAlias
Alias for the private key. -
keyPassword
Password for the private key. -
key
The singleton instance of the private key produced by this factory.
-
-
Constructor Details
-
PKCS11PrivateKeyFactoryBean
public PKCS11PrivateKeyFactoryBean()
-
-
Method Details
-
getPkcs11Config
Returns the PKCS#11 configuration.- Returns:
- returns the PKCS#11 configuration.
-
setPkcs11Config
Sets the PKCS#11 configuration to use.- Parameters:
config- the PKCS#11 configuration to use
-
getKeyAlias
Gets the key alias in use.- Returns:
- returns the key alias in use
-
setKeyAlias
Sets the key alias to use.- Parameters:
alias- the key alias to use
-
getKeyPassword
Gets the key password in use.- Returns:
- returns the key password in use
-
setKeyPassword
Set the key password to use.- Parameters:
password- the key password to use
-
getProvider
-
getKeyStore
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<PrivateKey>- Throws:
Exception
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<PrivateKey>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceFactoryBean<PrivateKey>
-