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

    Represents an algorithm identifier used throughout PKI standards.

    An AlgorithmIdentifier specifies a cryptographic algorithm along with any algorithm-specific parameters. It's used for signature algorithms, encryption algorithms, hash functions, and key derivation functions in X.509 certificates, PKCS structures, and other PKI objects.

    AlgorithmIdentifier  ::=  SEQUENCE  {
         algorithm               OBJECT IDENTIFIER,
         parameters              ANY DEFINED BY algorithm OPTIONAL
    }
    
    // RSA with PKCS#1 v1.5 padding
    const rsaAlg = new AlgorithmIdentifier({
    algorithm: '1.2.840.113549.1.1.1' // rsaEncryption OID
    })

    // RSA-PSS with specific parameters
    const rsaPssAlg = new AlgorithmIdentifier({
    algorithm: '1.2.840.113549.1.1.10', // rsassa-pss OID
    parameters: new RSASSAPSSParams({
    hashAlgorithm: new AlgorithmIdentifier({ algorithm: OIDs.sha256 }),
    saltLength: 32
    })
    })

    // Check algorithm type
    console.log(rsaAlg.friendlyName) // "rsaEncryption"

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    algorithm: ObjectIdentifier

    The algorithm object identifier (OID).

    noPadding: boolean = false

    Internal flag indicating whether this algorithm uses padding.

    parameters?: Any

    Algorithm-specific parameters (optional). The format depends on the specific algorithm.

    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