Class PublicKeyFactoryBean

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<java.security.PublicKey>, org.springframework.beans.factory.InitializingBean

    public class PublicKeyFactoryBean
    extends org.springframework.beans.factory.config.AbstractFactoryBean<java.security.PublicKey>
    FactoryBean for creating a public key from a file.
    Since:
    3.1
    • Field Summary

      • Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

        logger
      • Fields inherited from interface org.springframework.beans.factory.FactoryBean

        OBJECT_TYPE_ATTRIBUTE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.security.PublicKey createInstance()  
      java.lang.Class getObjectType()  
      protected java.security.PublicKey readDERPublicKey()
      Read der public key.
      protected java.security.PublicKey readPemPublicKey()
      Read pem public key.
      javax.crypto.Cipher toCipher()
      Initialize cipher based on service public key.
      • Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

        afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PublicKeyFactoryBean

        public PublicKeyFactoryBean()
    • Method Detail

      • toCipher

        public javax.crypto.Cipher toCipher()
        Initialize cipher based on service public key.
        Returns:
        the false if no public key is found or if cipher cannot be initialized, etc.
      • getObjectType

        public java.lang.Class getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean<java.security.PublicKey>
        Specified by:
        getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<java.security.PublicKey>
      • createInstance

        protected java.security.PublicKey createInstance()
                                                  throws java.lang.Exception
        Specified by:
        createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<java.security.PublicKey>
        Throws:
        java.lang.Exception
      • readPemPublicKey

        protected java.security.PublicKey readPemPublicKey()
                                                    throws java.lang.Exception
        Read pem public key.
        Returns:
        the public key
        Throws:
        java.lang.Exception - the exception
      • readDERPublicKey

        protected java.security.PublicKey readDERPublicKey()
                                                    throws java.lang.Exception
        Read der public key.
        Returns:
        the public key
        Throws:
        java.lang.Exception - the exception