Package org.forgerock.security.keystore
Class KeyStoreManager
- java.lang.Object
-
- org.forgerock.security.keystore.KeyStoreManager
-
public class KeyStoreManager extends Object
A class that manages a Java Key Store and has methods for extracting out public/private keys and certificates.
-
-
Constructor Summary
Constructors Constructor Description KeyStoreManager(KeyStore keyStore)
Constructs an instance of the KeyStoreManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Certificate
getCertificate(String certAlias)
Gets the certificate from the KeyStore with the given alias.KeyStore
getKeyStore()
Gets the managedKeyStore
.PrivateKey
getPrivateKey(String keyAlias, String privateKeyPassword)
Gets the Private Key from the KeyStore with the given alias.PublicKey
getPublicKey(String keyAlias)
Gets the Public Key from the KeyStore with the given alias.X509Certificate
getX509Certificate(String certAlias)
Gets a X509Certificate from the KeyStore with the given alias.
-
-
-
Method Detail
-
getCertificate
public Certificate getCertificate(String certAlias)
Gets the certificate from the KeyStore with the given alias.- Parameters:
certAlias
- The Certificate Alias.- Returns:
- The Certificate.
-
getX509Certificate
public X509Certificate getX509Certificate(String certAlias)
Gets a X509Certificate from the KeyStore with the given alias.- Parameters:
certAlias
- The Certificate Alias.- Returns:
- The X509Certificate.
-
getPublicKey
public PublicKey getPublicKey(String keyAlias)
Gets the Public Key from the KeyStore with the given alias.- Parameters:
keyAlias
- The Public Key Alias.- Returns:
- The Public Key.
-
getPrivateKey
public PrivateKey getPrivateKey(String keyAlias, String privateKeyPassword)
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.
-
-