AbstractProtected_Protected_Have these keys been deleted? A deleted keypair is terminal -- the key material is gone, and any use of it throws.
ReadonlyexchangeThe indexedDB names this keypair was loaded from, and the names
persist and delete will use.
ReadonlywriteStatic_StaticEXCHANGE_StaticWRITE_The machine-readable name for this keypair.
Drop the in-memory key material. Internal -- call delete instead.
AbstractdecryptOptionalpublicKeyOrKeysize: string | CryptoKey | SymmKeyLength | nullOptionalaesAlgorithm: string | nullAbstractdecryptOptionalpublicKeyOrKeysize: string | CryptoKey | SymmKeyLength | nullOptionalaesAlgorithm: string | nullDelete this keypair. This deletes the keys from indexedDB, drops the
in-memory key material, and clears the instance cache, so load will
not hand out these keys again.
After this, the instance is destroyed -- using it throws
a KeysDeletedError.
AbstractencryptBy default, encrypt the given data to yourself, as a "note to self".
Optionalrecipient: string | CryptoKey | nullOptionalaesKeyOrInfo: string | Uint8Array<ArrayBufferLike> | CryptoKey | nullOptionalkeysizeOrAesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey | SymmKeyLength | nullOptionalkeysize: SymmKeyLength | nullAbstractencryptOptionalrecipient: string | CryptoKey | nullOptionalaesKeyOrInfo: string | Uint8Array<ArrayBufferLike> | CryptoKey | nullOptionalkeysizeOrAesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey | SymmKeyLength | nullOptionalkeysize: SymmKeyLength | nullAbstractgetGet the relevant AES key.
OptionalpublicKey: string | CryptoKey | nullOptionalinfo: string | nullReturn a 32-character, DNS friendly hash of the public signing key.
Save this keys instance to indexedDB.
Optionalformat: SupportedEncodingsOptionalformat: SupportedEncodingsAbstractsignAbstractsignOptionalcharsize: CharSizeAbstracttoStatic_Optional_extractable: booleanStatic_Optional_extractable: booleanStatic_If the cached instance was loaded from the given names, then its keys are gone too. Destroy it, and clear the cache. Internal.
Static_The indexedDB names for this class, optionally prefixed with dbKey.
Pure -- never writes to the class statics.
OptionaldbKey: stringStaticcreateOptionalsession: booleanOptionalextractable: booleanOptionalkeys: {StaticdeleteDelete a stored keypair without loading it first. Deletes the keys from indexedDB, and destroys the cached instance, if there is one for these names.
Optionalopts: { encryptionKeyName?: string; writeKeyName?: string } = {}
The indexedDB names to delete. Defaults to this class's names.
StaticdeviceReturn a 32-character, DNS-friendly hash of the given DID.
A DID format string
32 character, base32 hash of the DID
StaticexistStaticloadRestore some keys from indexedDB, or create a new keypair if it doesn't exist yet.
By default this saves the keys to indexedDB before returning, so the
keypair you get back survives a page reload. Pass { persist: false }
to skip that and call .persist() yourself. Session keys are never
written to indexedDB, so { session: true } wins over persist.
dbKey prefixes both default indexedDB names. Other strings are
custom names, plus session and persist options.
The parent key. Doesn't implement the encrypt/sign functions.