Package org.forgerock.opendj.io.rx
Class ProxyProtocolHeader.SslTlv
- java.lang.Object
-
- org.forgerock.opendj.io.rx.ProxyProtocolHeader.SslTlv
-
- Enclosing class:
- ProxyProtocolHeader
public static final class ProxyProtocolHeader.SslTlv extends Object
Exposes the content of the "pp2_tlv_ssl" structure present in theProxyProtocolHeader.PP2_TYPE_SSLTLV header.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProxyProtocolHeader.SslTlv.ClientBitRepresents the possible values for the client property of the "pp2_tlv_ssl" structure.static classProxyProtocolHeader.SslTlv.SslSubTypeRepresents the possible types of the "sub_tlv" contained in the "pp2_tlv_ssl" structure present in theProxyProtocolHeader.PP2_TYPE_SSLTLV header.
-
Constructor Summary
Constructors Constructor Description SslTlv(EnumSet<ProxyProtocolHeader.SslTlv.ClientBit> client, int verify, EnumMap<ProxyProtocolHeader.SslTlv.SslSubType,String> subTlvs)Creates a new SSL TLV header.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProxyProtocolHeader.SslTlvdecode(ByteString data)Decodes the SSL information contained indatain TLV format.ByteStringencode()Encodes the SSL information into TLV format.booleanequals(Object o)StringgetCipher()Returns the name of the used cipher.StringgetCn()Returns the Common Name field of the client certificate's Distinguished Name.StringgetKeyAlgorithm()The algorithm used to generate the key of the certificate presented.StringgetSignatureAlgorithm()Returns the name of the used cipher.StringgetVersion()Returns the TLS version.inthashCode()booleanisSsl()Returns whether the client uses an SSL connection.booleanisVerified()Returns whether the client presented a certificate that was successfully verified.
-
-
-
Constructor Detail
-
SslTlv
public SslTlv(EnumSet<ProxyProtocolHeader.SslTlv.ClientBit> client, int verify, EnumMap<ProxyProtocolHeader.SslTlv.SslSubType,String> subTlvs)
Creates a new SSL TLV header.- Parameters:
client- Indicates which SSL element is present.verify-0if the client presented a certificate and it was successfully verified, and non-zero otherwise.subTlvs- the SSL information describing if and how the client connected using SSL. It must contain at least theProxyProtocolHeader.SslTlv.SslSubType.PP2_SUBTYPE_SSL_VERSIONifProxyProtocolHeader.SslTlv.ClientBit.PP2_CLIENT_SSLis set.
-
-
Method Detail
-
decode
public static ProxyProtocolHeader.SslTlv decode(ByteString data) throws DecodeException
Decodes the SSL information contained indatain TLV format.- Parameters:
data- The buffer containing the SSL information encoded in TLV format.- Returns:
- A new
ProxyProtocolHeader.SslTlvexposing SSL informations. - Throws:
DecodeException- If thedatacannot be decoded.- See Also:
ProxyProtocolHeader.PP2_TYPE_SSL
-
isSsl
public boolean isSsl()
Returns whether the client uses an SSL connection.- Returns:
trueif the client uses SSL.
-
isVerified
public boolean isVerified()
Returns whether the client presented a certificate that was successfully verified.- Returns:
trueif the client presented a certificate that was successfully verified.
-
getVersion
public String getVersion()
Returns the TLS version.- Returns:
- The US-ASCII string representation of the TLS version
-
getCn
public String getCn()
Returns the Common Name field of the client certificate's Distinguished Name.- Returns:
- The string representation (in UTF8) of the Common Name field (OID: 2.5.4.3) of the client certificate's Distinguished Name.
-
getCipher
public String getCipher()
Returns the name of the used cipher.- Returns:
- The US-ASCII string name of the used cipher, for example "ECDHE-RSA-AES128-GCM-SHA256".
-
getSignatureAlgorithm
public String getSignatureAlgorithm()
Returns the name of the used cipher.- Returns:
- The US-ASCII string name of the used cipher, for example "ECDHE-RSA-AES128-GCM-SHA256".
-
getKeyAlgorithm
public String getKeyAlgorithm()
The algorithm used to generate the key of the certificate presented.- Returns:
- The US-ASCII string name of the algorithm used to generate the key of the certificate presented by the frontend when the incoming connection was made over an SSL/TLS transport layer, for example "RSA2048"
-
encode
public ByteString encode()
Encodes the SSL information into TLV format.- Returns:
- A
ByteStringcontaining a TLV representation of the SSL informations. - See Also:
ProxyProtocolHeader.PP2_TYPE_SSL
-
-