Package com.networknt.http.client.ssl
Enum EndpointIdentificationAlgorithm
- java.lang.Object
-
- java.lang.Enum<EndpointIdentificationAlgorithm>
-
- com.networknt.http.client.ssl.EndpointIdentificationAlgorithm
-
- All Implemented Interfaces:
Serializable,Comparable<EndpointIdentificationAlgorithm>
public enum EndpointIdentificationAlgorithm extends Enum<EndpointIdentificationAlgorithm>
This Enum is used to support endpoint identification algorithms LDAPS (RFC 2830), HTTPS (RFC 2818), and APIS. HTTPS and LDAPS are standard algorithms, seeSSLParameters.setEndpointIdentificationAlgorithm(String). APIS is a custom algorithm for server identity check in light-4j.- Author:
- Daniel Zhao
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EndpointIdentificationAlgorithmselect(boolean checkIdentity, Set<String> trustedNameSet)Choose the algorithm to be used based on configuration.static voidsetup(Socket socket, EndpointIdentificationAlgorithm identityAlg)set EndpointIdentificationAlgorithm to SSLSocket EndpointIdentificationAlgorithm.APIS is not set because it'll cause unsupported algorithm exceptionsstatic voidsetup(SSLEngine engine, EndpointIdentificationAlgorithm identityAlg)set EndpointIdentificationAlgorithm to SSLEngine EndpointIdentificationAlgorithm.APIS is not set because it'll cause unsupported algorithm exceptionsstatic EndpointIdentificationAlgorithmvalueOf(String name)Returns the enum constant of this type with the specified name.static EndpointIdentificationAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HTTPS
public static final EndpointIdentificationAlgorithm HTTPS
-
LDAPS
public static final EndpointIdentificationAlgorithm LDAPS
-
APIS
public static final EndpointIdentificationAlgorithm APIS
-
-
Method Detail
-
values
public static EndpointIdentificationAlgorithm[] 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 (EndpointIdentificationAlgorithm c : EndpointIdentificationAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EndpointIdentificationAlgorithm 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 nameNullPointerException- if the argument is null
-
select
public static EndpointIdentificationAlgorithm select(boolean checkIdentity, Set<String> trustedNameSet)
Choose the algorithm to be used based on configuration.- Parameters:
checkIdentity- - from 'verifyHostName' of the client.ymltrustedNameSet- - from 'trustedNames' of the client.yml- Returns:
- the algorithm to be used.
-
setup
public static void setup(SSLEngine engine, EndpointIdentificationAlgorithm identityAlg)
set EndpointIdentificationAlgorithm to SSLEngine EndpointIdentificationAlgorithm.APIS is not set because it'll cause unsupported algorithm exceptions- Parameters:
engine- - ssl engineidentityAlg- - EndpointIdentificationAlgorithm to be used
-
setup
public static void setup(Socket socket, EndpointIdentificationAlgorithm identityAlg)
set EndpointIdentificationAlgorithm to SSLSocket EndpointIdentificationAlgorithm.APIS is not set because it'll cause unsupported algorithm exceptions- Parameters:
socket- - ssl socketidentityAlg- - EndpointIdentificationAlgorithm to be used
-
-