Skip to content
docs

Session

Defined in: session.ts:51

new Session(options): Session

Defined in: session.ts:67

SessionOptions

Session

get autoLockMs(): number

Defined in: session.ts:123

number

getKey(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: session.ts:103

The DEK for one operation (zeroize it after). locked when there is none or the timer ran out while the worker was asleep — the record is then removed as well, so a missed alarm cannot keep the key alive.

Promise<Uint8Array<ArrayBufferLike>>


isUnlocked(): Promise<boolean>

Defined in: session.ts:94

Promise<boolean>


lock(): Promise<void>

Defined in: session.ts:90

Forget the DEK and cancel the alarm. Safe to call when already locked.

Promise<void>


onLock(callback): () => void

Defined in: session.ts:134

() => void

() => void


setAutoLockMs(ms): Promise<void>

Defined in: session.ts:128

Change the timer (options page); re-arms from now when unlocked. 0 disables.

number

Promise<void>


touch(): Promise<void>

Defined in: session.ts:112

User activity: push the auto-lock out again. No-op when locked.

Promise<void>


unlock(dek): Promise<void>

Defined in: session.ts:79

Store the DEK and arm the auto-lock. The caller’s copy is zeroized.

Uint8Array

Promise<void>