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.
Type Parameters
Section titled “Type Parameters”T extends SignIdentity = SignIdentity
Properties
Section titled “Properties”durable
Section titled “durable”
readonlydurable:boolean
Defined in: src/client/credential-storage.ts:37
Whether what this writes survives the document being torn down.
shared
Section titled “shared”
readonlyshared:boolean
Defined in: src/client/credential-storage.ts:34
Whether another tab of this origin reads what this writes.
Methods
Section titled “Methods”create()
Section titled “create()”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.
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Credential<T> | null>
remove()
Section titled “remove()”remove(
slot):Promise<void>
Defined in: src/client/credential-storage.ts:55
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
set(
slot,credential):Promise<void>
Defined in: src/client/credential-storage.ts:53
Parameters
Section titled “Parameters”string
credential
Section titled “credential”Credential<T>
Returns
Section titled “Returns”Promise<void>