Package nts

Class NTSKEMessage

java.lang.Object
nts.NTSKEMessage

public class NTSKEMessage extends Object
  • Constructor Details

    • NTSKEMessage

      public NTSKEMessage()
  • Method Details

    • addNTSKERecord

      public void addNTSKERecord(NTSKERecord record)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toBytes

      public byte[] toBytes()
    • toByteString

      public String toByteString()
    • parseNTSKERawMessage

      public static NTSKEMessage parseNTSKERawMessage(byte[] raw_message, int size)
    • parseResponse

      public NTSConfig parseResponse(String KE_host, int KE_port)
      Parse the response from the NTS KE Server and extract the NTSConfig. TO DO: Check that there is only one of NTSNPN, AEADAN, and that EoM is the last record.
      Parameters:
      KE_host - host of the NTS KE Server, will be used as NTP host if the NTPv4ServerNegotiation record is not present.
      KE_port - port of the NTS KE Server, will be used as NTP port if the NTPv4PortNegotiation record is not present.
      Returns:
      Throws:
      IllegalStateException - if the NTS KE Server communicated an error or if no cookies were received.
      IllegalArgumentException - if the response has an Error or Warning record.