Package org.apache.tomcat.util.net
Interface SSLSupport
-
- All Known Implementing Classes:
AprSSLSupport,JSSESupport
public interface SSLSupportDefines an interface to interact with SSL sessions.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCERTIFICATE_KEYThe Request attribute key for the client certificate chain.static java.lang.StringCIPHER_SUITE_KEYThe Request attribute key for the cipher suite.static java.lang.StringKEY_SIZE_KEYThe Request attribute key for the key size.static java.lang.StringPROTOCOL_VERSION_KEYThe request attribute key under which the String indicating the protocol that created the SSL socket is recorded - e.g.static java.lang.StringREQUESTED_CIPHERS_KEYThe request attribute key under which the String indicating the ciphers requested by the client are recorded.static java.lang.StringREQUESTED_PROTOCOL_VERSIONS_KEYThe request attribute key under which the String indicating the protocols requested by the client are recorded.static java.lang.StringSESSION_ID_KEYThe Request attribute key for the session id.static java.lang.StringSESSION_MGRThe request attribute key for the session manager.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringgetCipherSuite()The cipher suite being used on this connection.java.lang.IntegergetKeySize()Get the keysize.default java.security.cert.X509Certificate[]getLocalCertificateChain()The server certificate chain (if any) that were sent to the peer.java.security.cert.X509Certificate[]getPeerCertificateChain()The client certificate chain (if any).java.lang.StringgetProtocol()java.lang.StringgetRequestedCiphers()java.lang.StringgetRequestedProtocols()java.lang.StringgetSessionId()The current session Id.
-
-
-
Field Detail
-
CIPHER_SUITE_KEY
static final java.lang.String CIPHER_SUITE_KEY
The Request attribute key for the cipher suite.- See Also:
- Constant Field Values
-
KEY_SIZE_KEY
static final java.lang.String KEY_SIZE_KEY
The Request attribute key for the key size.- See Also:
- Constant Field Values
-
CERTIFICATE_KEY
static final java.lang.String CERTIFICATE_KEY
The Request attribute key for the client certificate chain.- See Also:
- Constant Field Values
-
SESSION_ID_KEY
static final java.lang.String SESSION_ID_KEY
The Request attribute key for the session id. This one is a Tomcat extension to the Servlet spec.- See Also:
- Constant Field Values
-
SESSION_MGR
static final java.lang.String SESSION_MGR
The request attribute key for the session manager. This one is a Tomcat extension to the Servlet spec.- See Also:
- Constant Field Values
-
PROTOCOL_VERSION_KEY
static final java.lang.String PROTOCOL_VERSION_KEY
The request attribute key under which the String indicating the protocol that created the SSL socket is recorded - e.g. TLSv1 or TLSv1.2 etc.- See Also:
- Constant Field Values
-
REQUESTED_CIPHERS_KEY
static final java.lang.String REQUESTED_CIPHERS_KEY
The request attribute key under which the String indicating the ciphers requested by the client are recorded.- See Also:
- Constant Field Values
-
REQUESTED_PROTOCOL_VERSIONS_KEY
static final java.lang.String REQUESTED_PROTOCOL_VERSIONS_KEY
The request attribute key under which the String indicating the protocols requested by the client are recorded.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCipherSuite
java.lang.String getCipherSuite() throws java.io.IOExceptionThe cipher suite being used on this connection.- Returns:
- The name of the cipher suite as returned by the SSL/TLS implementation
- Throws:
java.io.IOException- If an error occurs trying to obtain the cipher suite
-
getPeerCertificateChain
java.security.cert.X509Certificate[] getPeerCertificateChain() throws java.io.IOExceptionThe client certificate chain (if any).- Returns:
- The certificate chain presented by the client with the peer's certificate first, followed by those of any certificate authorities
- Throws:
java.io.IOException- If an error occurs trying to obtain the certificate chain
-
getLocalCertificateChain
default java.security.cert.X509Certificate[] getLocalCertificateChain()
The server certificate chain (if any) that were sent to the peer.- Returns:
- The certificate chain sent with the server certificate first, followed by those of any certificate authorities
-
getKeySize
java.lang.Integer getKeySize() throws java.io.IOExceptionGet the keysize. What we're supposed to put here is ill-defined by the Servlet spec (S 4.7 again). There are at least 4 potential values that might go here: (a) The size of the encryption key (b) The size of the MAC key (c) The size of the key-exchange key (d) The size of the signature key used by the server Unfortunately, all of these values are nonsensical.- Returns:
- The effective key size for the current cipher suite
- Throws:
java.io.IOException- If an error occurs trying to obtain the key size
-
getSessionId
java.lang.String getSessionId() throws java.io.IOExceptionThe current session Id.- Returns:
- The current SSL/TLS session ID
- Throws:
java.io.IOException- If an error occurs trying to obtain the session ID
-
getProtocol
java.lang.String getProtocol() throws java.io.IOException- Returns:
- the protocol String indicating how the SSL socket was created e.g. TLSv1 or TLSv1.2 etc.
- Throws:
java.io.IOException- If an error occurs trying to obtain the protocol information from the socket
-
getRequestedProtocols
java.lang.String getRequestedProtocols() throws java.io.IOException- Returns:
- the list of SSL/TLS protocol versions requested by the client
- Throws:
java.io.IOException- If an error occurs trying to obtain the client requested protocol information from the socket
-
getRequestedCiphers
java.lang.String getRequestedCiphers() throws java.io.IOException- Returns:
- the list of SSL/TLS ciphers requested by the client
- Throws:
java.io.IOException- If an error occurs trying to obtain the client request cipher information from the socket
-
-