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

    Represents a MacData structure in a PKCS#12 file.

    MacData ::= SEQUENCE {
       mac        DigestInfo,
       macSalt    OCTET STRING,
       iterations INTEGER DEFAULT 1
    }
    

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    iterations: number
    macSalt: OctetString

    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 a PKCS#12 MacData: HMAC over data keyed by a key derived using the PKCS#12 password-based KDF (RFC 7292 Appendix B).

      Note: Uses the legacy PKCS#12 KDF for MAC key derivation to maintain compatibility with OpenSSL and other PKCS#12 implementations.

      Parameters

      • data: Uint8Array<ArrayBuffer>

        The data to compute MAC over

      • password: string | Uint8Array<ArrayBuffer>

        The password (string or bytes)

      • iterations: number

        Iteration count for KDF

      • hash: HashAlgorithm = 'SHA-256'

        Hash algorithm to use (default: SHA-256)

      Returns Promise<MacData>

      Promise resolving to MacData instance