Crypto Lib
    Preparing search index...

    Class Keyring

    In-memory keyring for storing, looking up, rotating, and exporting keys.

    Index
    • Decrypt and restore a keyring from an encrypted blob.

      Parameters

      • key: string | Uint8Array<ArrayBufferLike>

        256-bit key (hex or bytes).

      • encrypted: string

        Base64-encoded encrypted keyring.

      Returns Keyring

    • Generate a new key pair and add it to the keyring.

      Parameters

      • algorithm:
            | "ed25519"
            | "ml-kem-512"
            | "ml-kem-768"
            | "ml-kem-1024"
            | "ml-dsa-44"
            | "ml-dsa-65"
            | "ml-dsa-87"
            | "x25519"
            | "ed448"
            | "x448"
            | "p256"
            | "p384"
      • metadata: KeyMetadata = {}

      Returns KeyEntry

    • List all keys matching the optional filters.

      Parameters

      • Optionalfilters: {
            algorithm?:
                | "ed25519"
                | "ml-kem-512"
                | "ml-kem-768"
                | "ml-kem-1024"
                | "ml-dsa-44"
                | "ml-dsa-65"
                | "ml-dsa-87"
                | "x25519"
                | "ed448"
                | "x448"
                | "p256"
                | "p384";
            use?: "sig"
            | "enc";
            includeArchived?: boolean;
        }

      Returns KeyEntry[]

    • Encrypt the keyring with a password using secretbox.

      Parameters

      • key: string | Uint8Array<ArrayBufferLike>

        256-bit key (hex or bytes).

      Returns string