public class PKCS11SoftHsmProvider extends Object implements PKCS11Provider
This class utilises pkcs11-tool to initialize the HSM slot and to load keys and certificates into the soft HSM.
After import of keys in the folder. This class makes available the following information to support key import into key stores:
SUN_PROVIDER_PREFIX
Constructor and Description |
---|
PKCS11SoftHsmProvider(List<SoftHsmCredentialConfiguration> credentialConfigurationList,
String name,
String lib,
String pin,
PKCS11ProviderInstance providerInstance)
The constructor checks the specified key folder and forms a list of aliases of keys that can be imported.
|
PKCS11SoftHsmProvider(PKCS11SoftHsmProviderConfiguration configuration,
PKCS11ProviderInstance providerInstance)
Constructor taking a
PKCS11SoftHsmProviderConfiguration . |
Modifier and Type | Method and Description |
---|---|
List<String> |
getAliasList()
Returns the key aliases
|
static X509Certificate |
getCert(File certFile) |
Map<String,X509Certificate> |
getCertificateMap()
Returns a map of aliases and associated certificates.
|
List<String> |
getProviderNameList()
Returns the names of the PKCS#11 security provider.
|
public PKCS11SoftHsmProvider(List<SoftHsmCredentialConfiguration> credentialConfigurationList, String name, String lib, String pin, PKCS11ProviderInstance providerInstance)
credentialConfigurationList
- configuration data credentials to be loaded into Soft HSMname
- the name of this provider instance that will be used also as label of the slotlib
- the PKCS11 library location on the hostpin
- the soft HSM PINproviderInstance
- Provider instantiation implementation (Depending on runtime Java version)public PKCS11SoftHsmProvider(PKCS11SoftHsmProviderConfiguration configuration, PKCS11ProviderInstance providerInstance)
PKCS11SoftHsmProviderConfiguration
. See
PKCS11SoftHsmProvider(List, String, String, String, PKCS11ProviderInstance)
.configuration
- the configuration instanceproviderInstance
- Provider instantiation implementation (Depending on runtime Java version)public static X509Certificate getCert(File certFile) throws CertificateException, IOException
CertificateException
IOException
public List<String> getAliasList()
public List<String> getProviderNameList()
getProviderNameList
in interface PKCS11Provider
public Map<String,X509Certificate> getCertificateMap()
Copyright © 2018 Sweden Connect. All rights reserved.