Class TranscriptHash


  • public class TranscriptHash
    extends java.lang.Object
    • Constructor Detail

      • TranscriptHash

        public TranscriptHash​(int hashLength)
    • 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 the msgType parameter has value certificate, 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 the msgType parameter has value certificate, 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 the TlsConstants.HandshakeType type 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 the TlsConstants.HandshakeType type 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 -