- java.lang.Object
-
- net.luminis.tls.engine.impl.TranscriptHash
-
public class TranscriptHash extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TranscriptHash(int hashLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getClientHash(TlsConstants.HandshakeType msgType)Return the transcript hash for the messages in the handshake up to and including the indicated client message type.byte[]getHash(TlsConstants.HandshakeType msgType)Return the transcript hash for the messages in the handshake up to and including the indicated message type.byte[]getServerHash(TlsConstants.HandshakeType msgType)Return the transcript hash for the messages in the handshake up to and including the indicated server message type.voidrecord(HandshakeMessage msg)Record a handshake message for computing the transcript hash.voidrecordClient(HandshakeMessage msg)Record a client handshake message for computing the transcript hash.voidrecordServer(HandshakeMessage msg)Record a server handshake message for computing the transcript hash.
-
-
-
Method Detail
-
getHash
public byte[] getHash(TlsConstants.HandshakeType msgType)
Return the transcript hash for the messages in the handshake up to and including the indicated message type.- Parameters:
msgType-- Returns:
-
getClientHash
public byte[] getClientHash(TlsConstants.HandshakeType msgType)
Return the transcript hash for the messages in the handshake up to and including the indicated client message type. For example, when themsgTypeparameter has valuecertificate, the transcript hash for the concatenation of handshake messages up to (and including) the client certificate message is returned.- Parameters:
msgType-- Returns:
-
getServerHash
public byte[] getServerHash(TlsConstants.HandshakeType msgType)
Return the transcript hash for the messages in the handshake up to and including the indicated server message type. For example, when themsgTypeparameter has valuecertificate, the transcript hash for the concatenation of handshake messages up to (and including) the server certificate message is returned.- Parameters:
msgType-- Returns:
-
record
public void record(HandshakeMessage msg)
Record a handshake message for computing the transcript hash. The type of the message determines its position in the transcript hash computation.- Parameters:
msg-
-
recordClient
public void recordClient(HandshakeMessage msg)
Record a client handshake message for computing the transcript hash. This method is needed because theTlsConstants.HandshakeTypetype does not differentiate between client and server variants, whilst these variants have a different position in the transcript hash computation. Note that the term "client" here refers to the message type, not whether it is sent or received by a client. For example, a client certificate message is sent by the client and received by the server; both need to use this method to record the message.- Parameters:
msg-
-
recordServer
public void recordServer(HandshakeMessage msg)
Record a server handshake message for computing the transcript hash. This method is needed because theTlsConstants.HandshakeTypetype does not differentiate between client and server variants, whilst these variants have a different position in the transcript hash computation. Note that the term "server" here refers to the message type, not whether it is sent or received by a server. For example, a server certificate message is sent by the server and received by the client; both need to use this method to record the message.- Parameters:
msg-
-
-