bothy-sdk
    Preparing search index...

    Class DpopKey

    A DPoP key held in memory: ES256 (P-256) or EdDSA (Ed25519). Use DpopKey.generate once and DpopKey.load afterwards; DpopKey.jkt is the thumbprint the owner enters at createToken (dpop_jkt). A key store (for example an HSM) implements DpopSigner instead.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    The JWS alg of the proofs.

    jkt: string

    The RFC 7638 thumbprint of the public key.

    publicJwk: Readonly<Record<string, string>>

    The public JWK without private members.

    Methods

    • Returns the JWS signature of data: 64-byte R || S for ES256, raw Ed25519 for EdDSA.

      Parameters

      • data: Uint8Array

        The JWS signing input.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The signature.

    • Returns alg and jkt only, so a key never lands in JSON output.

      Returns Record<string, string>

    • Returns DpopKey(<alg>, jkt=<thumbprint>), never the key.

      Returns string

    • Creates a new key; with path it is written there as a PKCS#8 PEM of mode 0600.

      Parameters

      • options: { alg?: DpopAlgorithm; path?: string } = {}

        path of a new file (must not exist; opened with O_EXCL) and alg (default ES256).

      Returns Promise<DpopKey>

      The key.

      The EEXIST error of open when the file exists.

    • Loads a key that DpopKey.generate wrote (or any file loadDpopKey reads).

      Parameters

      • path: string

        The key file.

      Returns Promise<DpopKey>

      The key.

      When the file is accessible by group or others, or holds no usable private key.