public final class ClientHello extends HandshakeMessage
HelloRequest or on its own initiative in order to
re-negotiate the security parameters in an existing connection. See
RFC 5246.FRAGMENT_LENGTH_BITS, FRAGMENT_OFFSET_BITS, MESSAGE_HEADER_LENGTH_BYTES, MESSAGE_LENGTH_BITS, MESSAGE_SEQ_BITS, MESSAGE_TYPE_BITS| Constructor and Description |
|---|
ClientHello(ProtocolVersion version,
DTLSSession session,
List<SignatureAndHashAlgorithm> supportedSignatureAndHashAlgorithms,
List<CertificateType> supportedClientCertificateTypes,
List<CertificateType> supportedServerCertificateTypes,
List<XECDHECryptography.SupportedGroup> supportedGroups)
Creates a Client Hello message to be used for resuming an
existing DTLS session.
|
ClientHello(ProtocolVersion version,
List<CipherSuite> supportedCipherSuites,
List<SignatureAndHashAlgorithm> supportedSignatureAndHashAlgorithms,
List<CertificateType> supportedClientCertificateTypes,
List<CertificateType> supportedServerCertificateTypes,
List<XECDHECryptography.SupportedGroup> supportedGroups,
InetSocketAddress peerAddress)
Creates a Client Hello message to be sent to a server.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCompressionMethod(CompressionMethod compressionMethod) |
byte[] |
fragmentToByteArray()
The serialization of the handshake body (without the handshake header).
|
static ClientHello |
fromReader(org.eclipse.californium.elements.util.DatagramReader reader,
InetSocketAddress peerAddress)
Creates a new ClientHello instance from its byte representation.
|
List<CipherSuite> |
getCipherSuites() |
ClientCertificateTypeExtension |
getClientCertificateTypeExtension() |
ProtocolVersion |
getClientVersion() |
List<CompressionMethod> |
getCompressionMethods() |
ConnectionIdExtension |
getConnectionIdExtension()
Gets the connection id extension data from this message.
|
byte[] |
getCookie()
Get cookie.
|
HelloExtensions |
getExtensions()
Gets the client hello extensions the client has included in this message.
|
MaxFragmentLengthExtension |
getMaxFragmentLengthExtension()
Gets the MaximumFragmentLength extension data from this message.
|
int |
getMessageLength()
Must be implemented by each subclass.
|
HandshakeType |
getMessageType()
Returns the type of the handshake message.
|
Random |
getRandom() |
RecordSizeLimitExtension |
getRecordSizeLimitExtension()
Gets the RecordSizeLimit extension data from this message.
|
ServerCertificateTypeExtension |
getServerCertificateTypeExtension() |
ServerNameExtension |
getServerNameExtension()
Gets the Server Name Indication extension data from this message.
|
SessionId |
getSessionId() |
SupportedEllipticCurvesExtension |
getSupportedEllipticCurvesExtension()
Gets the supported elliptic curves.
|
SupportedPointFormatsExtension |
getSupportedPointFormatsExtension()
Gets the supported point formats.
|
SignatureAlgorithmsExtension |
getSupportedSignatureAlgorithms()
Gets the Signature and Hash Algorithms extension data from this message.
|
boolean |
hasSessionId()
Checks whether this message contains a session ID.
|
void |
setCompressionMethods(List<CompressionMethod> compressionMethods) |
void |
setCookie(byte[] cookie)
Set received cookie.
|
String |
toString() |
fragmentChanged, fromByteArray, fromGenericHandshakeMessage, getContentType, getFragmentLength, getFragmentOffset, getMessageSeq, getNextHandshakeMessage, getRawMessage, setMessageSeq, setNextHandshakeMessage, size, toByteArray, writeTogetPeerpublic ClientHello(ProtocolVersion version, List<CipherSuite> supportedCipherSuites, List<SignatureAndHashAlgorithm> supportedSignatureAndHashAlgorithms, List<CertificateType> supportedClientCertificateTypes, List<CertificateType> supportedServerCertificateTypes, List<XECDHECryptography.SupportedGroup> supportedGroups, InetSocketAddress peerAddress)
version - the protocol version to usesupportedCipherSuites - the list of the supported cipher suites in
order of the client’s preference (favorite choice first)supportedSignatureAndHashAlgorithms - the list of the supported
signature and hash algorithmssupportedClientCertificateTypes - the list of certificate types
supported by the clientsupportedServerCertificateTypes - the list of certificate types
supported by the serversupportedGroups - the list of the supported groups (curves) in order of
the client’s preference (favorite choice first)peerAddress - the IP address and port of the peer this message has
been received from or should be sent topublic ClientHello(ProtocolVersion version, DTLSSession session, List<SignatureAndHashAlgorithm> supportedSignatureAndHashAlgorithms, List<CertificateType> supportedClientCertificateTypes, List<CertificateType> supportedServerCertificateTypes, List<XECDHECryptography.SupportedGroup> supportedGroups)
version - the protocol version to usesession - the (already existing) DTLS session to resumesupportedSignatureAndHashAlgorithms - the list of the supported
signature and hash algorithmssupportedClientCertificateTypes - the list of certificate types
supported by the clientsupportedServerCertificateTypes - the list of certificate types
supported by the serversupportedGroups - the list of the supported groups (curves) in order of
the client’s preference (favorite choice first)public byte[] fragmentToByteArray()
HandshakeMessageClientHello, the
fragments are considered to be not modified. If a modification is required,
call HandshakeMessage.fragmentChanged().fragmentToByteArray in class HandshakeMessagepublic static ClientHello fromReader(org.eclipse.californium.elements.util.DatagramReader reader, InetSocketAddress peerAddress) throws HandshakeException
reader - reader with 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 any of the extensions included in the message is of an
unsupported typepublic HandshakeType getMessageType()
HandshakeMessageHandshakeType.getMessageType in class HandshakeMessageHandshakeType.public int getMessageLength()
HandshakeMessagegetMessageLength in class HandshakeMessagepublic String toString()
toString in class HandshakeMessagepublic ProtocolVersion getClientVersion()
public Random getRandom()
public SessionId getSessionId()
public boolean hasSessionId()
true if the message contains a non-null session ID with length > 0public byte[] getCookie()
Bytes.EMPTY, if no cookie is available.public void setCookie(byte[] cookie)
cookie - received cookieNullPointerException - if cookie is nullIllegalArgumentException - if cookie is emptypublic List<CipherSuite> getCipherSuites()
public List<CompressionMethod> getCompressionMethods()
public void setCompressionMethods(List<CompressionMethod> compressionMethods)
public void addCompressionMethod(CompressionMethod compressionMethod)
public HelloExtensions getExtensions()
null if no extensions are used.public SupportedEllipticCurvesExtension getSupportedEllipticCurvesExtension()
null.public SupportedPointFormatsExtension getSupportedPointFormatsExtension()
null.public ClientCertificateTypeExtension getClientCertificateTypeExtension()
null.public ServerCertificateTypeExtension getServerCertificateTypeExtension()
null.public SignatureAlgorithmsExtension getSupportedSignatureAlgorithms()
null if this message does not contain the
SignatureAlgorithms extension.public MaxFragmentLengthExtension getMaxFragmentLengthExtension()
null if this message does not contain the
MaximumFragmentLength extension.public RecordSizeLimitExtension getRecordSizeLimitExtension()
null if this message does not contain the
RecordSizeLimit extension.public ServerNameExtension getServerNameExtension()
null if this message does not contain the
Server Name Indication extension.public ConnectionIdExtension getConnectionIdExtension()
null if this message does not contain the
connection id extension.Copyright © 2023 Eclipse Foundation. All rights reserved.