public final class EcdhPskServerKeyExchange extends ECDHServerKeyExchange
ServerKeyExchange
message for PSK-ECDH based key exchange methods.
Contains the server's ephemeral public key as encoded point and the PSK
hint. See RFC
5489 for details. It is assumed, that the server's ECDH public key is not
in the servers's certificate, so it must be provided here.
According RFC
8422, 5.1.1. Supported Elliptic Curves Extension only "named curves" are
valid, the "prime" and "char2" curve descriptions are deprecated. Also only
"UNCOMPRESSED" as point format is valid, the other formats have been
deprecated.ECDHServerKeyExchange.EcdhData
FRAGMENT_LENGTH_BITS, FRAGMENT_OFFSET_BITS, MESSAGE_HEADER_LENGTH_BYTES, MESSAGE_LENGTH_BITS, MESSAGE_SEQ_BITS, MESSAGE_TYPE_BITS
Constructor and Description |
---|
EcdhPskServerKeyExchange(PskPublicInformation pskHint,
XECDHECryptography ecdhe)
Creates a new key exchange message with psk hint as clear text and ServerDHParams.
|
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)
Creates a new server key exchange instance from its byte representation.
|
PskPublicInformation |
getHint()
This method returns the preshared key hint used by server in
ServerKeyExchange
message. |
int |
getMessageLength()
Must be implemented by each subclass.
|
String |
toString() |
getEncodedPoint, getNamedCurveLength, getSupportedGroup, readNamedCurve, updateSignatureForNamedCurve, writeNamedCurve
getMessageType
fragmentChanged, fromByteArray, fromGenericHandshakeMessage, getContentType, getFragmentLength, getFragmentOffset, getMessageSeq, getNextHandshakeMessage, getRawMessage, setMessageSeq, setNextHandshakeMessage, size, toByteArray, writeTo
public EcdhPskServerKeyExchange(PskPublicInformation pskHint, XECDHECryptography ecdhe)
pskHint
- preshared key hint in clear textecdhe
- XECDHECryptography
including the supported group and the peer's public keyNullPointerException
- if the arguments pskHint or ecdhe are null
public byte[] fragmentToByteArray()
HandshakeMessage
ClientHello
, the
fragments are considered to be not modified. If a modification is required,
call HandshakeMessage.fragmentChanged()
.fragmentToByteArray
in class HandshakeMessage
public static HandshakeMessage fromReader(org.eclipse.californium.elements.util.DatagramReader reader) throws HandshakeException
reader
- reader for the binary encoding of the message.EcdhPskServerKeyExchange
HandshakeException
- if the byte array includes unsupported curveNullPointerException
- if either byteArray or peerAddress is null
public int getMessageLength()
HandshakeMessage
getMessageLength
in class HandshakeMessage
public PskPublicInformation getHint()
ServerKeyExchange
message. If psk hint not present this will return an empty string.public String toString()
toString
in class ECDHServerKeyExchange
Copyright © 2021 Eclipse Foundation. All rights reserved.