Skip to content

IdbCredentialStorage

Defined in: src/client/idb-credential-storage.ts:20

Credentials in IndexedDB, which is what a browser offers that can hold a key whose private half is unreadable.

A non-extractable CryptoKeyPair survives a structured clone, so what another tab reads is a handle that signs and cannot be exported — no key material is written anywhere.

implements CredentialStorage

new IdbCredentialStorage(options?): IdbCredentialStorage

Defined in: src/client/idb-credential-storage.ts:29

DBCreateOptions

Database name, store name and version.

IdbCredentialStorage

readonly durable: true = true

Defined in: src/client/idb-credential-storage.ts:22

Whether what this writes survives the document being torn down.

CredentialStorage.durable


readonly shared: true = true

Defined in: src/client/idb-credential-storage.ts:21

Whether another tab of this origin reads what this writes.

CredentialStorage.shared

create(): Promise<ECDSAKeyIdentity>

Defined in: src/client/idb-credential-storage.ts:49

A fresh identity of this store’s own type, not persisted.

Generation belongs to the store because the medium decides the key type: one that has to serialise needs a key whose private bytes are readable, and one that does not should not have them. Kept together so an application cannot pair a non-extractable key with a store that cannot hold one and find out at runtime.

Promise<ECDSAKeyIdentity>

CredentialStorage.create


get(slot): Promise<Credential<ECDSAKeyIdentity> | null>

Defined in: src/client/idb-credential-storage.ts:53

The credential stored under slot, or null where there is none.

string

Promise<Credential<ECDSAKeyIdentity> | null>

CredentialStorage.get


remove(slot): Promise<void>

Defined in: src/client/idb-credential-storage.ts:78

string

Promise<void>

CredentialStorage.remove


set(slot, credential): Promise<void>

Defined in: src/client/idb-credential-storage.ts:70

string

Credential<ECDSAKeyIdentity>

Promise<void>

CredentialStorage.set