-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtypes.ts
More file actions
50 lines (43 loc) · 956 Bytes
/
types.ts
File metadata and controls
50 lines (43 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export const STORAGE_KEY = "passkey-secret-demo:envelope:v1";
export type UnlockMethod = "recovery" | "passkey";
export interface ScryptKdf {
name: "scrypt";
salt: string;
N: number;
r: number;
p: number;
dkLen: number;
maxmem?: number;
}
export interface RecoveryWrap {
algorithm: "scrypt-aes-gcm";
nonce: string;
ct: string;
kdf: ScryptKdf;
}
export interface PasskeyWrap {
algorithm: "webauthn-prf-aes-gcm";
credentialId: string;
prfInput: string;
iv: string;
wrappedKey: string;
createdAt: string;
}
export interface StoredEnvelope {
version: 1;
createdAt: string;
ciphertext: string;
ciphertextIv: string;
recoveryWrap: RecoveryWrap;
passkeyWrap?: PasskeyWrap;
}
export interface DemoSession {
plaintext: string;
unlockedWith: UnlockMethod;
unlockedAt: string;
}
export interface PasskeyRegistration {
credentialId: string;
prfCreateSupported: boolean | null;
prfOutput?: Uint8Array;
}