public class StaticCachedPKCS11TokenKeyStoreProtectionManager extends StaticPKCS11TokenKeyStoreProtectionManager
StaticPKCS11TokenKeyStoreProtectionManager, however the
keystore and private key protection keys are loaded into the manager at init time and cached in the class. The advantage
is that multiple trips do not have to be made to the HSM to get the secret keys per certificate operation. They disadvantage
is that secret keys or cached in process memory.
This class is also a generic band aid for systems that get disconnected from their HSMs due to policy and technical reasons. These systems need access to the secret keys even after they are disconnected.
NOTE: PrivateKeyEntry object are not cached because most PKCS11 implementations consider them non-extractable meaning they cannot be taken off of the PKCS11 token and stored into process memory. A persistent connection the PKCS11 token is generally required for PrivateKeyEntry objects.
DEFAULT_KESTORE_TYPE, IV_BYTES, SUNPKCS11_KEYSTORE_PROVIDER_NAME, WRAP_ALGO| Constructor and Description |
|---|
StaticCachedPKCS11TokenKeyStoreProtectionManager()
Empty constructor
|
StaticCachedPKCS11TokenKeyStoreProtectionManager(PKCS11Credential credential,
String keyStorePassPhraseAlias,
String privateKeyPassPhraseAlias)
Constructs the store with a credential manager and aliases.
|
| Modifier and Type | Method and Description |
|---|---|
Key |
getKeyStoreProtectionKey()
Gets the key protecting private keys in the key store.
|
Key |
getPrivateKeyProtectionKey()
Gets the key protecting the key store as a whole.
|
void |
initTokenStore()
Initializes access to the token.
|
clearEntry, clearKey, clearKeyStoreProtectionKey, clearPrivateKeyProtectionKey, getAllEntries, getAllKeys, getEntry, getKey, getKS, setCredential, setEntry, setKey, setKeyStorePassPhraseAlias, setKeyStoreProtectionKey, setKeyStoreProtectionKeyAsBytes, setKeyStoreProtectionKeyAsString, setKeyStoreProviderName, setKeyStoreSource, setKeyStoreSourceAsString, setKeyStoreType, setPcks11ConfigFile, setPrivateKeyPassPhraseAlias, setPrivateKeyProtectionKey, setPrivateKeyProtectionKeyAsBytes, setPrivateKeyProtectionKeyAsString, unwrapWithSecretKey, wrapWithSecretKeypublic StaticCachedPKCS11TokenKeyStoreProtectionManager()
throws CryptoException
CryptoExceptionpublic StaticCachedPKCS11TokenKeyStoreProtectionManager(PKCS11Credential credential, String keyStorePassPhraseAlias, String privateKeyPassPhraseAlias) throws CryptoException
credential - The credentials to log into the store.keyStorePassPhraseAlias - The alias name of the key store key in the PKCS11 token.privateKeyPassPhraseAlias - The alias name of the private key protection key in the PKCS11 token.CryptoExceptionpublic void initTokenStore()
throws CryptoException
initTokenStore in class StaticPKCS11TokenKeyStoreProtectionManagerCryptoExceptionpublic Key getPrivateKeyProtectionKey() throws CryptoException
getPrivateKeyProtectionKey in interface KeyStoreProtectionManagergetPrivateKeyProtectionKey in class AbstractPKCS11TokenKeyStoreProtectionManagerCryptoExceptionpublic Key getKeyStoreProtectionKey() throws CryptoException
getKeyStoreProtectionKey in interface KeyStoreProtectionManagergetKeyStoreProtectionKey in class AbstractPKCS11TokenKeyStoreProtectionManagerCryptoExceptionCopyright © 2010–2021 The Direct Project. All rights reserved.