Class PrivateKeyFactoryBean

java.lang.Object
net.shibboleth.shared.spring.security.factory.PrivateKeyFactoryBean
All Implemented Interfaces:
FactoryBean<PrivateKey>

public class PrivateKeyFactoryBean extends Object implements FactoryBean<PrivateKey>
Spring bean factory for producing a PrivateKey from a Resource. This factory bean supports encrypted and non-encrypted PKCS8, DER, or PEM private key encoded resources.
  • Field Details

    • resource

      @Nullable private Resource resource
      Private key resource.
    • keyPass

      private String keyPass
      Password for the private key.
    • key

      private PrivateKey key
      The singleton instance of the private key produced by this factory.
  • Constructor Details

    • PrivateKeyFactoryBean

      public PrivateKeyFactoryBean()
  • Method Details

    • setResource

      public void setResource(@Nullable Resource res)
      Sets the resource containing the private key.
      Parameters:
      res - private key resource, never null
    • setPrivateKeyPassword

      public void setPrivateKeyPassword(@Nullable String password)
      Sets the password for the private key.
      Parameters:
      password - password for the private key, may be null if the key is not encrypted
    • getObject

      public PrivateKey getObject() throws Exception
      Specified by:
      getObject in interface FactoryBean<PrivateKey>
      Throws:
      Exception
    • getObjectType

      @Nonnull public Class<?> getObjectType()
      Specified by:
      getObjectType in interface FactoryBean<PrivateKey>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface FactoryBean<PrivateKey>