Class KeyStoreBasedKeyFactoryBean<T extends Key>

java.lang.Object
org.cryptacular.bean.KeyStoreBasedKeyFactoryBean<T>
Type Parameters:
T - Type of key, either SecretKey or PrivateKey.
All Implemented Interfaces:
FactoryBean<T>

public class KeyStoreBasedKeyFactoryBean<T extends Key> extends Object implements FactoryBean<T>
Factory that produces either a SecretKey or PrivateKey.

from a KeyStore.

Author:
Middleware Services
  • Constructor Details

    • KeyStoreBasedKeyFactoryBean

      public KeyStoreBasedKeyFactoryBean()
      Creates a new instance.
    • KeyStoreBasedKeyFactoryBean

      public KeyStoreBasedKeyFactoryBean(KeyStore keyStore, String alias, String password)
      Creates a new instance by specifying all properties.
      Parameters:
      keyStore - Key store containing encryption key.
      alias - Name of encryption key entry in key store.
      password - Password used to decrypt key entry in keystore.
  • Method Details

    • getKeyStore

      public KeyStore getKeyStore()
      Returns:
      Keystore that contains the keyStore.
    • setKeyStore

      public void setKeyStore(KeyStore keyStore)
      Sets the keystore that contains the key.
      Parameters:
      keyStore - Non-null keystore.
    • getAlias

      public String getAlias()
      Returns:
      Alias that specifies the KeyStore entry containing the key.
    • setAlias

      public void setAlias(String alias)
      Sets the alias that specifies the KeyStore entry containing the key.
      Parameters:
      alias - Keystore alias of key entry.
    • setPassword

      public void setPassword(String password)
      Sets the password used to access the key entry.
      Parameters:
      password - Key entry password.
    • newInstance

      public T newInstance()
      Specified by:
      newInstance in interface FactoryBean<T extends Key>
      Returns:
      New instance of the type handled by this factory.