Class KeyStoreFactory


  • public class KeyStoreFactory
    extends java.lang.Object
    A factory that creates and configures a new KeyStore instance.
    Author:
    Apache MINA Project
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyStoreFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.KeyStore newInstance()
      Creates a new KeyStore.
      void setData​(byte[] data)
      Sets the data which contains the key store.
      void setDataFile​(java.io.File dataFile)
      Sets the data which contains the key store.
      void setDataUrl​(java.net.URL dataUrl)
      Sets the data which contains the key store.
      void setPassword​(java.lang.String password)
      Sets the key store password.
      void setProvider​(java.lang.String provider)
      Sets the name of the provider to use when creating the key store.
      void setType​(java.lang.String type)
      Sets the type of key store to create.
      • Methods inherited from class java.lang.Object

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

      • KeyStoreFactory

        public KeyStoreFactory()
    • Method Detail

      • newInstance

        public java.security.KeyStore newInstance()
                                           throws java.security.KeyStoreException,
                                                  java.security.NoSuchProviderException,
                                                  java.security.NoSuchAlgorithmException,
                                                  java.security.cert.CertificateException,
                                                  java.io.IOException
        Creates a new KeyStore. This method will be called by the base class when Spring creates a bean using this FactoryBean.
        Returns:
        a new KeyStore instance.
        Throws:
        java.security.KeyStoreException - If we can't create an instance of the KeyStore for the given type
        java.security.NoSuchProviderException - If we don't have the provider registered to create the KeyStore
        java.security.NoSuchAlgorithmException - If the KeyStore algorithm cannot be used
        java.security.cert.CertificateException - If the KeyStore certificate cannot be loaded
        java.io.IOException - If the KeyStore cannot be loaded
      • setType

        public void setType​(java.lang.String type)
        Sets the type of key store to create. The default is to create a JKS key store.
        Parameters:
        type - the type to use when creating the key store.
        Throws:
        java.lang.IllegalArgumentException - if the specified value is null.
      • setPassword

        public void setPassword​(java.lang.String password)
        Sets the key store password. If this value is null no password will be used to check the integrity of the key store.
        Parameters:
        password - the password or null if no password is needed.
      • setProvider

        public void setProvider​(java.lang.String provider)
        Sets the name of the provider to use when creating the key store. The default is to use the platform default provider.
        Parameters:
        provider - the name of the provider, e.g. "SUN".
      • setData

        public void setData​(byte[] data)
        Sets the data which contains the key store.
        Parameters:
        data - the byte array that contains the key store
      • setDataFile

        public void setDataFile​(java.io.File dataFile)
                         throws java.io.IOException
        Sets the data which contains the key store.
        Parameters:
        dataFile - the File that contains the key store
        Throws:
        java.io.IOException - If we can't process the file
      • setDataUrl

        public void setDataUrl​(java.net.URL dataUrl)
                        throws java.io.IOException
        Sets the data which contains the key store.
        Parameters:
        dataUrl - the URL that contains the key store.
        Throws:
        java.io.IOException - If we can't process the URL