public final class Finished extends HandshakeMessage
ChangeCipherSpecMessage to verify that the key exchange and
authentication processes were successful. It is essential that a
ChangeCipherSpecMessage be received between the other handshake
messages and the Finished message. The Finished message is the first one
protected with the just negotiated algorithms, keys, and secrets. The value
handshake_messages includes all handshake messages starting at
ClientHello up to, but not including, this Finished message.
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 |
|---|
Finished(Mac hmac,
SecretKey masterSecret,
boolean isClient,
byte[] handshakeHash,
InetSocketAddress peerAddress)
Generates the verify data according to RFC 5246:
PRF(master_secret, finished_label, Hash(handshake_messages)). |
| 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) |
int |
getMessageLength()
Must be implemented by each subclass.
|
HandshakeType |
getMessageType()
Returns the type of the handshake message.
|
String |
toString() |
void |
verifyData(Mac hmac,
SecretKey masterSecret,
boolean isClient,
byte[] handshakeHash)
See RFC
5246: All of the data from all messages in this handshake (not
including any HelloRequest messages) up to, but not including, this
message.
|
fragmentChanged, fromByteArray, fromGenericHandshakeMessage, getContentType, getFragmentLength, getFragmentOffset, getMessageSeq, getNextHandshakeMessage, getRawMessage, setMessageSeq, setNextHandshakeMessage, size, toByteArray, writeTogetPeerpublic Finished(Mac hmac, SecretKey masterSecret, boolean isClient, byte[] handshakeHash, InetSocketAddress peerAddress)
PRF(master_secret, finished_label, Hash(handshake_messages)).hmac - the mac. e.g. HmacSHA256masterSecret - the master_secretisClient - to determine the finished_labelhandshakeHash - the hashpeerAddress - the IP address and port of the peer this
message has been received from or should be sent topublic void verifyData(Mac hmac, SecretKey masterSecret, boolean isClient, byte[] handshakeHash) throws HandshakeException
hmac - the mac. e.g. HmacSHA256masterSecret - the master secret.isClient - whether the verify data comes from the client or the server.handshakeHash - the handshake hash.HandshakeException - if the data can not be verified.public HandshakeType getMessageType()
HandshakeMessageHandshakeType.getMessageType in class HandshakeMessageHandshakeType.public int getMessageLength()
HandshakeMessagegetMessageLength in class HandshakeMessagepublic String toString()
toString in class HandshakeMessagepublic 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)
Copyright © 2023 Eclipse Foundation. All rights reserved.