Crypto Server
    Preparing search index...

    Class KeyStore

    Index
    • Parameters

      • dir: string | undefined

        Directory to persist keys to, or undefined for memory only.

      • capacity: number = DEFAULT_KEY_CAPACITY

        Keys held in memory. Without a directory, generation fails with 503 once it is reached; with one, the oldest key leaves memory and is read back from disk on use.

      • OptionalstorageKey: string | Uint8Array<ArrayBufferLike>

        Master key for encrypting private keys at rest (AES-256-GCM): 32 bytes, or 64 hex characters. Anything else throws.

      • options: KeyStoreOptions = {}

      Returns KeyStore

    • Delete the key keyId owned by owner, from memory and disk. Throws 404 for an unknown key or another owner's, as get does.

      Parameters

      • keyId: string
      • owner: string

      Returns Promise<void>

    • The key keyId owned by owner, checked against the algorithms the operation accepts (any, when omitted). Throws 404 for an unknown key or another owner's, and 400 for a key of another algorithm.

      Parameters

      • keyId: string
      • owner: string
      • Optionalalgorithms: readonly string[]

      Returns Promise<StoredKey>