Package org.certificateservices.messages
Class DefaultPKCS11ProviderManager
- java.lang.Object
-
- org.certificateservices.messages.DefaultPKCS11ProviderManager
-
- All Implemented Interfaces:
PKCS11ProviderManager
public class DefaultPKCS11ProviderManager extends java.lang.Object implements PKCS11ProviderManager
PKCS#11 provider manager in charge of creating, adding and loading a java PKCS#11 keystore, using Sun PKCS#11.
-
-
Constructor Summary
Constructors Constructor Description DefaultPKCS11ProviderManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringaddPKCS11Provider(java.io.InputStream config)Create and add a PKCS#11 provider to the systemstatic java.security.ProvidercreatePKCS11Provider(java.io.InputStream config)java.security.KeyStoreloadPKCS11Keystore(char[] password)Load the PKCS#11 keystore and make it available for use.
-
-
-
Method Detail
-
createPKCS11Provider
public static java.security.Provider createPKCS11Provider(java.io.InputStream config) throws java.lang.SecurityException, java.lang.NullPointerException, java.security.ProviderException- Throws:
java.lang.SecurityExceptionjava.lang.NullPointerExceptionjava.security.ProviderException
-
addPKCS11Provider
public java.lang.String addPKCS11Provider(java.io.InputStream config) throws java.lang.SecurityException, java.lang.NullPointerException, java.security.ProviderExceptionCreate and add a PKCS#11 provider to the system- Specified by:
addPKCS11Providerin interfacePKCS11ProviderManager- Parameters:
config- Configuration to use when creating the provider- Returns:
- the name of the created provider.
- Throws:
java.lang.NullPointerException- If an empty provider was created based on the configuration.java.lang.SecurityException- If a security manager exists and its SecurityManager.checkSecurityAccess method denies access to add a new providerjava.security.ProviderException- If error occurred when creating the provider.
-
loadPKCS11Keystore
public java.security.KeyStore loadPKCS11Keystore(char[] password) throws java.security.KeyStoreException, java.security.cert.CertificateException, java.security.NoSuchAlgorithmException, java.io.IOExceptionLoad the PKCS#11 keystore and make it available for use.- Specified by:
loadPKCS11Keystorein interfacePKCS11ProviderManager- Parameters:
password- PKCS#11 Password to use when loading keystore- Returns:
- Java PKCS#11 keystore
- Throws:
java.security.KeyStoreException- If error occurred when instantiating the keystore.java.security.cert.CertificateException- If any of the certificates in the keystore could not be loaded.java.security.NoSuchAlgorithmException- if the algorithm used to check the integrity of the keystore cannot be foundjava.io.IOException- If there was a problem loading the keystore (not found or incorrect password).
-
-