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

    Represents an EC private key according to RFC 5915.

    ASN.1 Structure:

    ECPrivateKey ::= SEQUENCE {
    version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
    privateKey OCTET STRING,
    parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
    publicKey [1] BIT STRING OPTIONAL
    }

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new ECPrivateKey

      Parameters

      • options: {
            namedCurve?: string;
            privateKey: Uint8Array;
            publicKey?: Uint8Array<ArrayBufferLike>;
        }

      Returns ECPrivateKey

    Properties

    namedCurve?: string

    The named curve OID (if parameters are present) Most commonly this is a string like '1.2.840.10045.3.1.7' for P-256

    privateKey: Uint8Array

    The private key value as an octet string

    publicKey?: Uint8Array<ArrayBufferLike>

    The key component (if included)

    version: number = 1

    The version of the EC private key structure (always 1)

    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 ECPrivateKey for a specific named curve

      Parameters

      • curve: string

        The named curve OID (e.g., EC_CURVES.SECP256R1)

      • privateKey: Uint8Array

        The private key value

      • OptionalpublicKey: Uint8Array<ArrayBufferLike>

        Optional key value

      Returns ECPrivateKey

      An ECPrivateKey object