public final class CertificateVerify extends HandshakeMessage
ClientKeyExchange
message. For further details 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 |
---|
CertificateVerify(SignatureAndHashAlgorithm signatureAndHashAlgorithm,
PrivateKey clientPrivateKey,
List<HandshakeMessage> handshakeMessages)
Called by client to create its CertificateVerify 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) |
int |
getMessageLength()
Must be implemented by each subclass.
|
HandshakeType |
getMessageType()
Returns the type of the handshake message.
|
void |
verifySignature(PublicKey clientPublicKey,
List<HandshakeMessage> handshakeMessages)
Tries to verify the client's signature contained in the CertificateVerify
message.
|
fragmentChanged, fromByteArray, fromGenericHandshakeMessage, getContentType, getFragmentLength, getFragmentOffset, getMessageSeq, getNextHandshakeMessage, getRawMessage, setMessageSeq, setNextHandshakeMessage, size, toByteArray, toString, writeTo
public CertificateVerify(SignatureAndHashAlgorithm signatureAndHashAlgorithm, PrivateKey clientPrivateKey, List<HandshakeMessage> handshakeMessages)
signatureAndHashAlgorithm
- the signature and hash algorithm used to create the signature.clientPrivateKey
- the client's private key to sign the signature.handshakeMessages
- the handshake messages which are signed.public HandshakeType getMessageType()
HandshakeMessage
HandshakeType
.getMessageType
in class HandshakeMessage
HandshakeType
.public int getMessageLength()
HandshakeMessage
getMessageLength
in class HandshakeMessage
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)
public void verifySignature(PublicKey clientPublicKey, List<HandshakeMessage> handshakeMessages) throws HandshakeException
clientPublicKey
- the client's public key.handshakeMessages
- the handshake messages exchanged so far.HandshakeException
- if the signature could not be verified.Copyright © 2021 Eclipse Foundation. All rights reserved.