PKI-Lite - v1.0.12
    Preparing search index...

    Accuracy structure for RFC 3161 Time-Stamp Protocol.

    Specifies the accuracy of the time in the timestamp token. All fields are optional, but at least one should be present.

    Accuracy ::= SEQUENCE {
        seconds        INTEGER           OPTIONAL,
        millis     [0] INTEGER  (1..999) OPTIONAL,
        micros     [1] INTEGER  (1..999) OPTIONAL  }
    

    RFC 3161 Section 2.4.2 - TSTInfo Structure

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new Accuracy instance.

      Parameters

      • options: { micros?: number; millis?: number; seconds?: number }

        Configuration object for accuracy values

        • Optionalmicros?: number

          Optional accuracy in microseconds (1-999)

        • Optionalmillis?: number

          Optional accuracy in milliseconds (1-999)

        • Optionalseconds?: number

          Optional accuracy in seconds

      Returns Accuracy

      Error if millis or micros are out of valid range

      const accuracy = new Accuracy({
      seconds: 1,
      millis: 500,
      micros: 250
      })

    Properties

    micros?: number

    Accuracy in microseconds (1-999), optional

    millis?: number

    Accuracy in milliseconds (1-999), optional

    seconds?: number

    Accuracy in seconds, optional

    Accessors

    • get pemHeader(): string

      Gets the PEM header name for this object type. Converts the class name to uppercase for use in PEM encoding.

      Returns string

    • get pkiType(): string

      Gets the PKI type name for this object (typically the class name). Used for PEM headers and debugging output.

      Returns string

    Methods

    • Compares this PKI object with another for equality. Two objects are considered equal if their DER encodings are identical.

      Parameters

      • other: PkiBase<any>

        The other PKI object to compare with

      Returns boolean

      true if the objects are equal, false otherwise

    • Returns a human-readable string representation of this object. By default, returns the same as toString(), but subclasses can override for more user-friendly output.

      Returns string

      A human-readable string representation

    • Creates an Accuracy from an ASN.1 structure.

      Parameters

      Returns Accuracy

      The parsed Accuracy object

      Asn1ParseError if the ASN.1 structure is invalid

      const asn1 = derToAsn1(accuracyBytes)
      const accuracy = Accuracy.fromAsn1(asn1)
      console.log(accuracy.seconds, accuracy.millis, accuracy.micros)