Skip to main content

KeysApi

@webda/sealed-client


Interface: KeysApi

Defined in: packages/sealed-client/src/api.ts:25

The User.Keys.* operations of the server, supplied by the host application (see restKeysApi)

Methods​

getEscrow()​

getEscrow(kind): Promise<{ escrow: EscrowBlob; keyring: KeyringBlob; publicKeys: ServedPublicKey[]; }>

Defined in: packages/sealed-client/src/api.ts:47

User.Keys.GetEscrow (throttled, fresh authentication required)

Parameters​

kind​

"password" | "recovery"

escrow kind

Returns​

Promise<{ escrow: EscrowBlob; keyring: KeyringBlob; publicKeys: ServedPublicKey[]; }>

the escrow, the encrypted keyring and the public keys


getKeyring()​

getKeyring(): Promise<{ keyring: KeyringBlob; publicKeys: ServedPublicKey[]; }>

Defined in: packages/sealed-client/src/api.ts:64

User.Keys.GetKeyring (fresh authentication required, not throttled): the encrypted keyring alone, to refresh a stale local copy with the keyring key this device holds

Returns​

Promise<{ keyring: KeyringBlob; publicKeys: ServedPublicKey[]; }>

the encrypted keyring and the public keys


getKeys()​

getKeys(): Promise<{ devices: ServedDevice[]; publicKeys: ServedPublicKey[]; }>

Defined in: packages/sealed-client/src/api.ts:30

Public part of the user keys

Returns​

Promise<{ devices: ServedDevice[]; publicKeys: ServedPublicKey[]; }>

the served public keys (oldest first) and devices


registerDevice()​

registerDevice(name): Promise<{ id: string; }>

Defined in: packages/sealed-client/src/api.ts:81

User.Keys.RegisterDevice

Parameters​

name​

string

device name

Returns​

Promise<{ id: string; }>

the device id


removeEscrow()​

removeEscrow(kind): Promise<void>

Defined in: packages/sealed-client/src/api.ts:58

User.Keys.RemoveEscrow: the server refuses to remove the last escrow while no device is registered (409)

Parameters​

kind​

"password" | "recovery"

escrow kind

Returns​

Promise<void>


revokeDevice()​

revokeDevice(id): Promise<void>

Defined in: packages/sealed-client/src/api.ts:86

User.Keys.RevokeDevice

Parameters​

id​

string

device id

Returns​

Promise<void>


rotate()​

rotate(publicKey, keyring, escrows?): Promise<void>

Defined in: packages/sealed-client/src/api.ts:71

User.Keys.Rotate: new active public key, keyring re-encrypted for it

Parameters​

publicKey​

PublicKeyEntry

new public key

keyring​

KeyringBlob

keyring holding every private key, encrypted for the new key

escrows?​

Partial<Record<"password" | "recovery", EscrowBlob>>

escrows of a new keyring key, the current escrows are kept when omitted

Returns​

Promise<void>


setEscrow()​

setEscrow(kind, escrow): Promise<void>

Defined in: packages/sealed-client/src/api.ts:53

User.Keys.SetEscrow: create or replace an escrow

Parameters​

kind​

"password" | "recovery"

escrow kind

escrow​

EscrowBlob

escrow blob

Returns​

Promise<void>


setup()​

setup(publicKey, keyring, escrows): Promise<void>

Defined in: packages/sealed-client/src/api.ts:37

User.Keys.Setup: first enrollment

Parameters​

publicKey​

PublicKeyEntry

first public key

keyring​

KeyringBlob

keyring encrypted for it

escrows​

Partial<Record<EscrowKind, EscrowBlob>>

escrows of the keyring key by kind

Returns​

Promise<void>