Skip to content

CredentialStorage

Defined in: src/client/credential-storage.ts:32

Holds the material a client acts with, a credential per slot.

Asynchronous, because using a credential means making a call and a non-extractable key needs a store that can hold one. What a page renders on is the state rather than this, so nothing here has to answer without awaiting.

A store knows two things about its medium that the library cannot infer, and declares both.

T extends SignIdentity = SignIdentity

readonly durable: boolean

Defined in: src/client/credential-storage.ts:37

Whether what this writes survives the document being torn down.


readonly shared: boolean

Defined in: src/client/credential-storage.ts:34

Whether another tab of this origin reads what this writes.

create(): Promise<T>

Defined in: src/client/credential-storage.ts:48

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<T>


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

Defined in: src/client/credential-storage.ts:51

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

string

Promise<Credential<T> | null>


remove(slot): Promise<void>

Defined in: src/client/credential-storage.ts:55

string

Promise<void>


set(slot, credential): Promise<void>

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

string

Credential<T>

Promise<void>