Class AbstractSunPkcs11Configuration
- All Implemented Interfaces:
Pkcs11Configuration
- Direct Known Subclasses:
CustomPkcs11Configuration
,FilePkcs11Configuration
,StaticPkcs11Configuration
This implementation assumes that the SunPKCS11 security provider is used, or other security providers that supports
the KeyStoreSpi
.
The method getBaseProviderName()
must be overridden if another security provider than SunPKCS11 is being
used.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor.protected
AbstractSunPkcs11Configuration
(String baseProviderName) Constructor setting the "base provider name". -
Method Summary
Modifier and TypeMethodDescriptionprotected final String
Gets the name of the security provider that we use to create new instances that have names according to<base-provider-name>-<instance-name>
, where 'instance-name' is gotten from the configuration.protected abstract String
Gets the configuration data for this configuration.Gets the Java securityProvider
to use when setting up a PKCS#11 credential.void
init()
An init method that should be called to fully initialize the configuration object.toString()
-
Field Details
-
DEFAULT_PROVIDER_NAME
Default provider name.- See Also:
-
-
Constructor Details
-
AbstractSunPkcs11Configuration
protected AbstractSunPkcs11Configuration()Default constructor. -
AbstractSunPkcs11Configuration
Constructor setting the "base provider name".Assigns the name of the security provider that we use to create new instances that have names according to
<base-provider-name>-<instance-name>
, where 'instance-name' is gotten from the configuration. Implementations wishing to use another provider than "SunPKCS11" should supply this provider name.- Parameters:
baseProviderName
- the base provider name
-
-
Method Details
-
init
An init method that should be called to fully initialize the configuration object.- Throws:
Pkcs11ConfigurationException
- for configuration errors
-
getProvider
Gets the Java securityProvider
to use when setting up a PKCS#11 credential.- Specified by:
getProvider
in interfacePkcs11Configuration
- Returns:
- a Provider instance
- Throws:
Pkcs11ConfigurationException
- if the configuration is incorrect
-
getBaseProviderName
Gets the name of the security provider that we use to create new instances that have names according to<base-provider-name>-<instance-name>
, where 'instance-name' is gotten from the configuration.- Returns:
- the provider name (SunPKCS11 is used for the default implementation)
-
getConfigurationData
Gets the configuration data for this configuration. The data returned is supplied in theProvider.configure(String)
call that is made to configure the PKCS#11 security provider.The returned string represents either a file name to an PKCS#11 configuration file or PKCS#11 configuration commands (in that case the string must be prefixed with
--
.Note: For configuration objects using a pre-configured security provider, the method must return
null
.- Returns:
- configuration data for a PKCS#11 provider, or
null
if no configuration is needed
-
toString
-