APIdia Launch Partner
Top Description Constructors Methods
java.net

public abstract Class SecureCacheResponse

extends CacheResponse
Class Inheritance
Imports
java.security.cert.Certificate, javax.net.ssl.SSLSession, .SSLPeerUnverifiedException, java.security.Principal, java.util.List, .Optional

Represents a cache response originally retrieved through secure means, such as TLS.
Since
1.5

Constructor Summary

AccessConstructor and Description
public
SecureCacheResponse()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

a string representing the cipher suite
getCipherSuite
()

Returns the cipher suite in use on the original connection that retrieved the network resource.

public abstract List<Certificate>

Returns:

an immutable List of Certificate representing the certificate chain that was sent to the server. If no certificate chain was sent, null will be returned.
getLocalCertificateChain
()

Returns the certificate chain that were sent to the server during handshaking of the original connection that retrieved the network resource.

public abstract Principal

Returns:

the principal sent to the server. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned.
getLocalPrincipal
()

Returns the principal that was sent to the server during handshaking in the original connection that retrieved the network resource.

public abstract Principal

Returns:

the server's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites.
getPeerPrincipal
()

Returns the server's principal which was established as part of defining the session during the original connection that retrieved the network resource.

public abstract List<Certificate>

Returns:

an immutable List of Certificate representing the server's certificate chain.
getServerCertificateChain
()

Returns the server's certificate chain, which was established as part of defining the session in the original connection that retrieved the network resource, from cache.

public Optional<SSLSession>

Returns:

an Optional containing the SSLSession in use on the original connection
getSSLSession
()

Returns an Optional containing the SSLSession in use on the original connection that retrieved the network resource.

Inherited from java.net.CacheResponse:
getBodygetHeaders

Constructor Detail

SecureCacheResponseback to summary
public SecureCacheResponse()

Constructor for subclasses to call.

Method Detail

getCipherSuiteback to summary
public abstract String getCipherSuite()

Returns the cipher suite in use on the original connection that retrieved the network resource.

Returns:String

a string representing the cipher suite

getLocalCertificateChainback to summary
public abstract List<Certificate> getLocalCertificateChain()

Returns the certificate chain that were sent to the server during handshaking of the original connection that retrieved the network resource.

Note

This method is useful only when using certificate-based cipher suites.

Returns:List<Certificate>

an immutable List of Certificate representing the certificate chain that was sent to the server. If no certificate chain was sent, null will be returned.

See Also
getLocalPrincipal()
getLocalPrincipalback to summary
public abstract Principal getLocalPrincipal()

Returns the principal that was sent to the server during handshaking in the original connection that retrieved the network resource.

Returns:Principal

the principal sent to the server. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned.

See Also
getLocalCertificateChain(), getPeerPrincipal()
getPeerPrincipalback to summary
public abstract Principal getPeerPrincipal() throws SSLPeerUnverifiedException

Returns the server's principal which was established as part of defining the session during the original connection that retrieved the network resource.

Returns:Principal

the server's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites.

Exceptions
SSLPeerUnverifiedException:
if the peer was not verified.
See Also
getServerCertificateChain(), getLocalPrincipal()
getServerCertificateChainback to summary
public abstract List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException

Returns the server's certificate chain, which was established as part of defining the session in the original connection that retrieved the network resource, from cache.

Note

This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.

Returns:List<Certificate>

an immutable List of Certificate representing the server's certificate chain.

Exceptions
SSLPeerUnverifiedException:
if the peer is not verified.
See Also
getPeerPrincipal()
getSSLSessionback to summary
public Optional<SSLSession> getSSLSession()

Returns an Optional containing the SSLSession in use on the original connection that retrieved the network resource. Returns an empty Optional if the underlying implementation does not support this method.

Implementation Specification

For compatibility, the default implementation of this method returns an empty Optional. Subclasses should override this method with an appropriate implementation since an application may need to access additional parameters associated with the SSL session.

Returns:Optional<SSLSession>

an Optional containing the SSLSession in use on the original connection

Since
12
See Also
SSLSession