Enum KeyStoreType

  • All Implemented Interfaces:
    Serializable, Comparable<KeyStoreType>

    public enum KeyStoreType
    extends Enum<KeyStoreType>
    The semantic keyStoreType of the Keystore.

    The specific documentation is inspired from https://www.java67.com/2012/12/difference-between-truststore-vs.html.

    Whats the difference? keystore is used to store server's own certificate while truststore is used to store the certificate of other parties issued by CA.

    Author:
    Oliver Wolff
    • Enum Constant Detail

      • TRUST_STORE

        public static final KeyStoreType TRUST_STORE
        A truststore is
        • used to store others credential: Certificates from CAs or you company, Customers,...
        • java-property: javax.net.ssl.trustStore
        • Default location for Java installations:
          • Oracle: JAVA_HOME/JRE/Security/cacerts
          • Zulu / OpenJDK: JAVA_HOME/lib/security/cacerts
        .
      • KEY_STORE

        public static final KeyStoreType KEY_STORE
        A keystore is
        • used to store your credential (server or client)
        • needed when you are setting up server side on SSL. It is used to store server's identity certificate, which server will present to a client on the connection while trust store setup on client side must contain to make the connection work. If you browser to connect to any website over SSL it verifies certificate presented by server against its truststore.
        • java-property: javax.net.ssl.keyStore
        .
    • Method Detail

      • values

        public static KeyStoreType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (KeyStoreType c : KeyStoreType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyStoreType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null