Package org.simpleframework.transport
Class NegotiationState
java.lang.Object
org.simpleframework.transport.NegotiationState
- All Implemented Interfaces:
Certificate
The
NegotiationState
represents the certificate
that is sent by a client during a secure HTTPS conversation. This
may or may not contain an X509 certificate chain from the client.
If it does not a CertificateChallenge
may be used to
issue a renegotiation of the connection. One completion of the
renegotiation the challenge executes a completion operation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
TheChallenge
object is used to enable the server to challenge for the client X509 certificate if desired.private class
TheDelegate
is basically a settable runnable object. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NegotiationState.Challenge
This is the challenge used to request the client certificate.private final NegotiationState.Delegate
This is the runnable task that is executed on task completion.private final RunnableFuture
<Certificate> This is used to hold the completion task for the challenge.private final Negotiation
This is the handshake used to acquire the certificate details.private final Socket
This is the socket representing the underlying TCP connection. -
Constructor Summary
ConstructorsConstructorDescriptionNegotiationState
(Negotiation negotiation, Socket socket) Constructor for theNegotiationCertificate
object. -
Method Summary
Modifier and TypeMethodDescriptiongetChain()
This will return the X509 certificate chain, if any, that has been sent by the client.This returns a challenge for the certificate.This returns the completion task associated with any challenge made for the client certificate.This is used to acquire the SSL session associated with the handshake.boolean
This is used to determine if the X509 certificate chain is present for the request.boolean
This is used to determine if the state is in challenge mode.
-
Field Details
-
future
This is used to hold the completion task for the challenge. -
negotiation
This is the handshake used to acquire the certificate details. -
challenge
This is the challenge used to request the client certificate. -
delegate
This is the runnable task that is executed on task completion. -
socket
This is the socket representing the underlying TCP connection.
-
-
Constructor Details
-
NegotiationState
Constructor for theNegotiationCertificate
object. This creates an object used to provide certificate details and a means to challenge for certificate details for the connected client if required.- Parameters:
negotiation
- the negotiation associated with thissocket
- the underlying TCP connection to the client
-
-
Method Details
-
isChallenge
public boolean isChallenge()This is used to determine if the state is in challenge mode. In challenge mode a challenge future will be executed on completion of the challenge. This will the completion task.- Returns:
- this returns true if the state is in challenge mode
-
getFuture
This returns the completion task associated with any challenge made for the client certificate. If this returns null then no challenge has been made for the client certificate.- Returns:
- this returns the challenge completion task if any
-
getChallenge
This returns a challenge for the certificate. A challenge is issued by providing aRunnable
task which is to be executed when the challenge has completed. Typically this task should be used to drive completion of an HTTPS request.- Specified by:
getChallenge
in interfaceCertificate
- Returns:
- this returns a challenge for the client certificate
- Throws:
Exception
-
getChain
This will return the X509 certificate chain, if any, that has been sent by the client. A certificate chain is typically only send when the server explicitly requests the certificate on the initial connection or when it is challenged for.- Specified by:
getChain
in interfaceCertificate
- Returns:
- this returns the clients X509 certificate chain
- Throws:
Exception
-
getSession
This is used to acquire the SSL session associated with the handshake. The session makes all of the details associated with the handshake available, including the cipher suites used and the SSL context used to create the session.- Returns:
- the SSL session associated with the connection
- Throws:
Exception
-
isChainPresent
public boolean isChainPresent()This is used to determine if the X509 certificate chain is present for the request. If it is not present then a challenge can be used to request the certificate.- Specified by:
isChainPresent
in interfaceCertificate
- Returns:
- true if the certificate chain is present
-