Class KeyStoreFactory

java.lang.Object
org.apache.mina.filter.ssl.KeyStoreFactory

public class KeyStoreFactory extends Object
A factory that creates and configures a new KeyStore instance.
  • Field Details

    • type

      private String type
    • provider

      private String provider
    • password

      private char[] password
    • data

      private byte[] data
  • Constructor Details

    • KeyStoreFactory

      public KeyStoreFactory()
  • Method Details

    • newInstance

      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:
      KeyStoreException - If we can't create an instance of the KeyStore for the given type
      NoSuchProviderException - If we don't have the provider registered to create the KeyStore
      NoSuchAlgorithmException - If the KeyStore algorithm cannot be used
      CertificateException - If the KeyStore certificate cannot be loaded
      IOException - If the KeyStore cannot be loaded
    • setType

      public void setType(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:
      IllegalArgumentException - if the specified value is null.
    • setPassword

      public void setPassword(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(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
    • setData

      private void setData(InputStream dataStream) throws IOException
      Sets the data which contains the key store.
      Parameters:
      dataStream - the InputStream that contains the key store
      Throws:
      IOException - If we can't process the stream
    • setDataFile

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

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