Class KeyStoreFactoryBean

java.lang.Object
org.cryptacular.bean.KeyStoreFactoryBean
All Implemented Interfaces:
FactoryBean<KeyStore>

public class KeyStoreFactoryBean extends Object implements FactoryBean<KeyStore>
Factory bean that produces a KeyStore from a file or URI.
Author:
Middleware Services
  • Field Details

  • Constructor Details

    • KeyStoreFactoryBean

      public KeyStoreFactoryBean()
      Creates a new instance.
    • KeyStoreFactoryBean

      public KeyStoreFactoryBean(Resource resource, String type, String password)
      Creates a new instance by specifying all properties.
      Parameters:
      resource - Resource containing encoded keystore data.
      type - Keystore type, e.g. JCEKS.
      password - Password used to decrypt key entry in keystore.
  • Method Details

    • getType

      public String getType()
      Returns:
      Keystore type.
    • setType

      public void setType(String type)
      Sets the keystore type.
      Parameters:
      type - JCEKS (default), JKS, PKCS12, or BKS. NOTE: BKS type is supported only when BC provider is installed.
    • getResource

      public Resource getResource()
      Returns:
      Resource that provides encoded keystore data.
    • setResource

      public void setResource(Resource resource)
      Sets the resource that provides encoded keystore data.
      Parameters:
      resource - Keystore resource.
    • setPassword

      public void setPassword(String password)
      Sets the keystore password required to decrypt an encrypted keystore.
      Parameters:
      password - Keystore password.
    • newInstance

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