Class TrustStoreDescriptor

java.lang.Object
org.refcodes.security.TrustStoreDescriptor
All Implemented Interfaces:
org.refcodes.mixin.Disposable
Direct Known Subclasses:
KeyStoreDescriptor

public class TrustStoreDescriptor extends Object implements org.refcodes.mixin.Disposable
Describes the data required to access a truststore. A truststore stores certificates from third party to identify third party and signed by certificate authorities such as "Verisign", "Thawte", or "GoDaddy". A client will use certificates stored in a truststore to verify the identity of a server.
  • Constructor Details

    • TrustStoreDescriptor

      public TrustStoreDescriptor(File aStoreFile)
      Constructs a KeyStoreDescriptor with the data required to access a KeyStore. The StoreType defaults to StoreType.JKS.
      Parameters:
      aStoreFile - The keystore File.
    • TrustStoreDescriptor

      public TrustStoreDescriptor(File aStoreFile, StoreType aStoreType)
      Constructs a KeyStoreDescriptor with the data required to access a KeyStore.
      Parameters:
      aStoreFile - The keystore File.
      aStoreType - The keystore's StoreType.
    • TrustStoreDescriptor

      public TrustStoreDescriptor(File aStoreFile, char[] aStorePassword)
      Constructs a KeyStoreDescriptor with the data required to access a KeyStore.
      Parameters:
      aStoreFile - The keystore File.
      aStorePassword - The keystore password.
    • TrustStoreDescriptor

      public TrustStoreDescriptor(File aStoreFile, StoreType aStoreType, char[] aStorePassword)
      Constructs a KeyStoreDescriptor with the data required to access a KeyStore.
      Parameters:
      aStoreFile - The keystore File.
      aStoreType - The keystore's StoreType.
      aStorePassword - The keystore password.
  • Method Details

    • getStoreFile

      public File getStoreFile()
      Retrieves the File pointing to the KeyStore.
      Returns:
      The KeyStore File.
    • getStoreType

      public StoreType getStoreType()
      Retrieves the StoreType representing the type of the KeyStore.
      Returns:
      The KeyStore's StoreType.
    • getStorePassword

      public char[] getStorePassword()
      Retrieves the keysotre's password.
      Returns:
      The KeyStore password.
    • dispose

      public void dispose()

      Note: The passwords are overwritten with zeros and all fields are set to null: The instance will not be usable afterwards.

      Specified by:
      dispose in interface org.refcodes.mixin.Disposable