Class ResourceBasedSecretKeyFactoryBean

java.lang.Object
org.cryptacular.bean.ResourceBasedSecretKeyFactoryBean
All Implemented Interfaces:
FactoryBean<SecretKey>

public class ResourceBasedSecretKeyFactoryBean extends Object implements FactoryBean<SecretKey>
Factory that produces a SecretKey from a Resource.
Author:
Middleware Services
  • Constructor Details

    • ResourceBasedSecretKeyFactoryBean

      public ResourceBasedSecretKeyFactoryBean()
      Creates a new instance.
    • ResourceBasedSecretKeyFactoryBean

      public ResourceBasedSecretKeyFactoryBean(Resource resource, String algorithm)
      Creates a new instance by specifying all properties.
      Parameters:
      resource - Resource containing encoded key data.
      algorithm - Algorithm name of cipher with which key will be used.
  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Returns:
      Key algorithm name, e.g. AES.
    • setAlgorithm

      public void setAlgorithm(String algorithm)
      Sets the key algorithm.
      Parameters:
      algorithm - Secret key algorithm, e.g. AES.
    • getResource

      public Resource getResource()
      Returns:
      Resource containing key data.
    • setResource

      public void setResource(Resource resource)
      Sets the resource containing key data.
      Parameters:
      resource - Resource containing key bytes.
    • newInstance

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