Enum StartTLSOptions

  • All Implemented Interfaces:
    Serializable, Comparable<StartTLSOptions>

    public enum StartTLSOptions
    extends Enum<StartTLSOptions>
    possible options for a secure connection using TLS
    either DISABLED, OPTIONAL or REQUIRED

    DISABLED means STARTTLS will not be used in any case

    OPTIONAL means STARTTLS will be used if the server supports it and a plain connection will be used otherwise; please note that this option is not as secure as it seems since a MITM attacker can remove the STARTTLS line from the capabilities reply.

    REQUIRED means that STARTTLS will be used if the server supports it and the send operation will fail otherwise

    Author:
    Alexander Lehmann
    • Method Detail

      • values

        public static StartTLSOptions[] 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 (StartTLSOptions c : StartTLSOptions.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StartTLSOptions 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