Package org.forgerock.security.keystore
Class KeyStoreManager
java.lang.Object
org.forgerock.security.keystore.KeyStoreManager
A class that manages a Java Key Store and has methods for extracting out public/private keys and certificates.
-
Constructor Summary
ConstructorDescriptionKeyStoreManager
(KeyStore keyStore) Constructs an instance of the KeyStoreManager. -
Method Summary
Modifier and TypeMethodDescriptiongetCertificate
(String certAlias) Gets the certificate from the KeyStore with the given alias.Gets the managedKeyStore
.getPrivateKey
(String keyAlias, String privateKeyPassword) Gets the Private Key from the KeyStore with the given alias.getPublicKey
(String keyAlias) Gets the Public Key from the KeyStore with the given alias.getX509Certificate
(String certAlias) Gets a X509Certificate from the KeyStore with the given alias.
-
Constructor Details
-
KeyStoreManager
Constructs an instance of the KeyStoreManager.- Parameters:
keyStore
- The managedKeyStore
. The key store must already be loaded.
-
-
Method Details
-
getCertificate
Gets the certificate from the KeyStore with the given alias.- Parameters:
certAlias
- The Certificate Alias.- Returns:
- The Certificate.
-
getX509Certificate
Gets a X509Certificate from the KeyStore with the given alias.- Parameters:
certAlias
- The Certificate Alias.- Returns:
- The X509Certificate.
-
getPublicKey
Gets the Public Key from the KeyStore with the given alias.- Parameters:
keyAlias
- The Public Key Alias.- Returns:
- The Public Key.
-
getPrivateKey
Gets the Private Key from the KeyStore with the given alias.- Parameters:
keyAlias
- The Private Key Alias.privateKeyPassword
- The private key password- Returns:
- The Private Key.
-
getKeyStore
Gets the managedKeyStore
.- Returns:
- The managed
KeyStore
.
-