public class PEMPKCS8KeyMasterConfiguration extends java.lang.Object implements IKeyMasterConfiguration
The PEMPKCS8KeyMasterConfiguration
class creates a configuration for KeyMaster using a private key stored in
a pkcs#8 PEM format file. The private key must not be password protected.
Use the following openssl command to convert an openssl generated PEM file to a pkcs8 encoded PEM file
openssl pkcs8 -topk8 -inform PEM -outform PEM -in privatekey_openssl.pem -out privatekey.pem -nocrypt
Constructor and Description |
---|
PEMPKCS8KeyMasterConfiguration(java.lang.String pemKeyFile,
KeyMasterHashingAlgorithm hashingAlgorithm,
java.lang.String securityProviderName)
Initializes a new instance of the
PEMPKCS8KeyMasterConfiguration class that uses the private key in the
supplied PKCS#8 PEM format file. |
Modifier and Type | Method and Description |
---|---|
KeyMasterHashingAlgorithm |
getHashingAlgorithm()
Gets the hashing algorithm that is used to generate the KeyMaster token.
|
java.security.PrivateKey |
getPrivateKey()
Gets a private key object.
|
java.lang.String |
getSecurityProviderName()
The name of the Java Security provider to be used to generate the token.
|
java.lang.String |
toString() |
public PEMPKCS8KeyMasterConfiguration(java.lang.String pemKeyFile, KeyMasterHashingAlgorithm hashingAlgorithm, java.lang.String securityProviderName) throws java.lang.Exception
PEMPKCS8KeyMasterConfiguration
class that uses the private key in the
supplied PKCS#8 PEM format file.pemKeyFile
- The file pathname of the PEM private key file.hashingAlgorithm
- The hashing algorithm to use.securityProviderName
- The name of the security provider to use or null to use the first suitable security provider registered.java.lang.IllegalArgumentException
- The specified key file is an inappropriate format.java.lang.Exception
- The specified key file cannot be found.public java.security.PrivateKey getPrivateKey()
IKeyMasterConfiguration
The KeyMaster token generator retrieves this property whenever it needs to generate a token.
getPrivateKey
in interface IKeyMasterConfiguration
public KeyMasterHashingAlgorithm getHashingAlgorithm()
IKeyMasterConfiguration
getHashingAlgorithm
in interface IKeyMasterConfiguration
public java.lang.String getSecurityProviderName()
IKeyMasterConfiguration
getSecurityProviderName
in interface IKeyMasterConfiguration
public java.lang.String toString()
toString
in class java.lang.Object
Please send bug reports and comments to Caplin support