public final class ServerHello extends HandshakeMessage
ClientHello
message received from a client.
The server will send this message in response to a ClientHello
message when it was able to find an acceptable set of algorithms. If it
cannot find such a match, it will respond with a handshake failure alert. See
RFC 5246 for
further details.FRAGMENT_LENGTH_BITS, FRAGMENT_OFFSET_BITS, MESSAGE_HEADER_LENGTH_BYTES, MESSAGE_LENGTH_BITS, MESSAGE_SEQ_BITS, MESSAGE_TYPE_BITS| Constructor and Description |
|---|
ServerHello(ProtocolVersion version,
Random random,
SessionId sessionId,
CipherSuite cipherSuite,
CompressionMethod compressionMethod,
HelloExtensions extensions,
InetSocketAddress peerAddress)
Constructs a full ServerHello message.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
fragmentToByteArray()
The serialization of the handshake body (without the handshake header).
|
static HandshakeMessage |
fromReader(org.eclipse.californium.elements.util.DatagramReader reader,
InetSocketAddress peerAddress)
Creates a Server Hello object from its binary encoding as used on
the wire.
|
CipherSuite |
getCipherSuite()
Gets the cipher suite the server has chosen for the session being negotiated.
|
CompressionMethod |
getCompressionMethod()
Gets the compression method the server has chosen for the session being negotiated.
|
ConnectionIdExtension |
getConnectionIdExtension()
Gets the connection id extension data from this message.
|
HelloExtensions |
getExtensions()
Gets the server hello extensions the server has included in this message.
|
int |
getMessageLength()
Must be implemented by each subclass.
|
HandshakeType |
getMessageType()
Returns the type of the handshake message.
|
Random |
getRandom()
Gets the server's random value to use for generating the key material.
|
ProtocolVersion |
getServerVersion()
Gets the DTLS version the server is willing to use.
|
SessionId |
getSessionId()
Gets the identifier the server has created for the session being negotiated.
|
String |
toString() |
fragmentChanged, fromByteArray, fromGenericHandshakeMessage, getContentType, getFragmentLength, getFragmentOffset, getMessageSeq, getNextHandshakeMessage, getRawMessage, setMessageSeq, setNextHandshakeMessage, size, toByteArray, writeTogetPeerpublic ServerHello(ProtocolVersion version, Random random, SessionId sessionId, CipherSuite cipherSuite, CompressionMethod compressionMethod, HelloExtensions extensions, InetSocketAddress peerAddress)
version - the negotiated version (highest supported by server).random - the server's random.sessionId - the new session's identifier.cipherSuite - the negotiated cipher suite.compressionMethod - the negotiated compression method.extensions - a list of extensions supported by the client (may be null).peerAddress - the IP address and port of the peer this
message has been received from or should be sent toNullPointerException - if any of the mandatory parameters is nullpublic byte[] fragmentToByteArray()
HandshakeMessageClientHello, the
fragments are considered to be not modified. If a modification is required,
call HandshakeMessage.fragmentChanged().fragmentToByteArray in class HandshakeMessagepublic static HandshakeMessage fromReader(org.eclipse.californium.elements.util.DatagramReader reader, InetSocketAddress peerAddress) throws HandshakeException
reader - reader for the binary encoding of the message.peerAddress - the IP address and port of the peer this
message has been received from or should be sent toHandshakeException - if the cipher suite code selected by the server is either
unknown, i.e. not defined in CipherSuite at all, or
CipherSuite.TLS_NULL_WITH_NULL_NULLpublic HandshakeType getMessageType()
HandshakeMessageHandshakeType.getMessageType in class HandshakeMessageHandshakeType.public int getMessageLength()
HandshakeMessagegetMessageLength in class HandshakeMessagepublic ProtocolVersion getServerVersion()
public Random getRandom()
public SessionId getSessionId()
public CipherSuite getCipherSuite()
public CompressionMethod getCompressionMethod()
public HelloExtensions getExtensions()
null if no extensions are used.public ConnectionIdExtension getConnectionIdExtension()
null if this message does not contain the
connection id extension.public String toString()
toString in class HandshakeMessageCopyright © 2023 Eclipse Foundation. All rights reserved.