Class 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 Detail

      • KeyStoreManager

        public KeyStoreManager​(KeyStore keyStore)
        Constructs an instance of the KeyStoreManager.
        Parameters:
        keyStore - The managed KeyStore. The key store must already be loaded.
    • 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.