public class ServerHandshaker extends Handshaker
Handshaker class.| Modifier and Type | Field and Description |
|---|---|
protected static HandshakeState[] |
NO_CLIENT_CERTIFICATE |
protected List<XECDHECryptography.SupportedGroup> |
supportedGroups
The supported groups (curves) ordered by preference.
|
advancedPskStore, certificateChain, certificateVerfied, certificateVerifier, clientRandom, connectionIdGenerator, flightNumber, handshakeMessages, isClient, LOGGER, masterSecret, peerCertPath, privateKey, publicKey, reassembledMessage, recordSizeLimit, serverRandom, session, sniEnabled, states, statesIndex, usedProtocol, useKeyUsageVerification, useStateValidation, useTruncatedCertificatePathForVerification| Constructor and Description |
|---|
ServerHandshaker(int initialMessageSequenceNo,
DTLSSession session,
RecordLayer recordLayer,
ScheduledExecutorService timer,
Connection connection,
DtlsConnectorConfig config)
Creates a handshaker for negotiating a DTLS session with a client
following the full DTLS handshake protocol.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doProcessMessage(HandshakeMessage message)
Does the specific processing of a message received from a peer in
the course of an ongoing handshake.
|
PskPublicInformation |
getPreSharedKeyIdentity() |
protected void |
negotiateCipherSuite(ClientHello clientHello,
HelloExtensions serverHelloExtensions)
Selects one of the client's proposed cipher suites.
|
protected void |
processCertificateVerified()
Do the handshaker specific processing of successful verified certificates
|
protected void |
processHelloExtensions(ClientHello clientHello,
HelloExtensions serverHelloExtensions) |
protected void |
processMasterSecret(SecretKey masterSecret)
Do the handshaker specific master secret processing
|
void |
startHandshake()
Starts the handshake by sending the first flight to the peer.
|
addApplicationDataForDeferredProcessing, addRecordsForDeferredProcessing, addSessionListener, applyMasterSecret, calculateKeys, completePendingFlight, createFlight, ensureUndestroyed, expectChangeCipherSpecMessage, expectMessage, generateRandomSeed, getClientRandom, getConnection, getFailureCause, getHandshakeMessageDigest, getPeerAddress, getReadConnectionId, getServerRandom, getSession, handshakeAborted, handshakeCompleted, handshakeFailed, handshakeFlightRetransmitted, handshakeStarted, hasSessionEstablished, isChangeCipherSpecMessageExpected, isDestroyed, isExpired, isInboundMessageProcessed, isProbing, isPskRequestPending, isRemovingConnection, processAsyncHandshakeResult, processAsyncPskSecretResult, processCertificateVerificationResult, processMessage, processPskSecretResult, reassembleFragment, removeSessionListener, requestPskSecretResult, resetProbing, sendFlight, sendLastFlight, sessionEstablished, setCurrentReadState, setCurrentWriteState, setFailureCause, setGenerateClusterMacKeys, takeDeferredApplicationData, takeDeferredApplicationData, takeDeferredRecords, verifyCertificate, wrapMessageprotected static HandshakeState[] NO_CLIENT_CERTIFICATE
protected final List<XECDHECryptography.SupportedGroup> supportedGroups
public ServerHandshaker(int initialMessageSequenceNo,
DTLSSession session,
RecordLayer recordLayer,
ScheduledExecutorService timer,
Connection connection,
DtlsConnectorConfig config)
initialMessageSequenceNo - the initial message sequence number to expect from the peer
(this parameter can be used to initialize the receive_next_seq
counter to another value than 0, e.g. if one or more cookie exchange round-trips
have been performed with the peer before the handshake starts).session - the session to negotiate with the client.recordLayer - the object to use for sending flights to the peer.timer - scheduled executor for flight retransmission (since 2.4).connection - the connection related with the session.config - the DTLS configuration.IllegalStateException - if the message digest required for computing the FINISHED message hash cannot be instantiated.IllegalArgumentException - if the initialMessageSequenceNo is negative.NullPointerException - if session, recordLayer or config is null.public PskPublicInformation getPreSharedKeyIdentity()
protected void doProcessMessage(HandshakeMessage message) throws HandshakeException, GeneralSecurityException
HandshakerdoProcessMessage in class Handshakermessage - the message received from the peerHandshakeException - if the record's plaintext fragment cannot be parsed into
a handshake message or cannot be processed properlyGeneralSecurityException - if the record's ciphertext fragment cannot be decryptedprotected void processMasterSecret(SecretKey masterSecret)
HandshakerprocessMasterSecret in class HandshakermasterSecret - master secretprotected void processCertificateVerified()
HandshakerprocessCertificateVerified in class Handshakerprotected void processHelloExtensions(ClientHello clientHello, HelloExtensions serverHelloExtensions)
public void startHandshake()
throws HandshakeException
HandshakerThe particular message to be sent depends on this peer's role in the handshake, i.e. if this end represents the client or server.
startHandshake in class HandshakerHandshakeException - if the message to start the handshake cannot be
created and sent using the session's current security parameters.protected void negotiateCipherSuite(ClientHello clientHello, HelloExtensions serverHelloExtensions) throws HandshakeException
Iterates through the provided (ordered) list of the client's
preferred ciphers until one is found that is also contained
in the supportedCipherSuites.
If the client proposes an ECC based cipher suite this method also tries
to determine an appropriate Supported Group by means of invoking
the getCommonSupportedGroups(ClientHello) method. If at least
one group is found it will be stored in the
selectedCipherSuiteParameters list. A ECC based cipher suite
will only be accepted, if a server certificate with the used curve is
available.
The selected cipher suite is set on the session to be negotiated
using the DTLSSession.setCipherSuite(CipherSuite) method. The
negotiatedServerCertificateType, negotiatedClientCertificateType
and negotiatedSupportedGroup fields are set to values corresponding to
the selected cipher suite.
The SSL_NULL_WITH_NULL_NULL cipher suite is never negotiated as mandated by RFC 5246 Appendix A.5
clientHello - the CLIENT_HELLO message containing the list of cipher suites
the client supports (ordered by preference).serverHelloExtensions - the container object to add server extensions to that are required for the selected
cipher suite.HandshakeException - if this server's configuration does not support any of the cipher suites
proposed by the client.public void destroy()
throws DestroyFailedException
destroy in interface Destroyabledestroy in class HandshakerDestroyFailedExceptionCopyright © 2023 Eclipse Foundation. All rights reserved.