Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / shared / lib / webauthn / interface.ts
blob855892ef0a8a0c80d674b2f0f0cde3ae529b4da8
1 export interface PublicKeyCredentialUserEntitySerialized extends Omit<PublicKeyCredentialUserEntity, 'id'> {
2     id: number[];
5 export interface PublicKeyCredentialDescriptorSerialized extends Omit<PublicKeyCredentialDescriptor, 'id'> {
6     id: number[];
9 export interface PublicKeyCredentialCreationOptionsSerialized
10     extends Omit<PublicKeyCredentialCreationOptions, 'challenge' | 'user' | 'excludeCredentials'> {
11     challenge: number[];
12     user: PublicKeyCredentialUserEntitySerialized;
13     excludeCredentials?: PublicKeyCredentialDescriptorSerialized[];
16 export interface RegistrationOptions {
17     publicKey: PublicKeyCredentialCreationOptionsSerialized;
20 export interface PublicKeyCredentialRequestOptionsSerialized
21     extends Omit<PublicKeyCredentialRequestOptions, 'challenge' | 'allowCredentials'> {
22     challenge: number[];
23     allowCredentials: PublicKeyCredentialDescriptorSerialized[];
26 export interface AuthenticationOptions {
27     publicKey: PublicKeyCredentialRequestOptionsSerialized;
30 export enum AttestationFormat {
31     None = 'none',
32     AndroidKey = 'android-key',
33     AndroidSafetyNet = 'android-safetynet',
34     Apple = 'apple',
35     FidoU2F = 'fido-u2f',
36     Packed = 'packed',
37     TPM = 'tpm',
40 export interface RegisteredKey {
41     AttestationFormat: AttestationFormat;
42     CredentialID: number[];
43     Name: string;
46 export interface RegisterCredentials {
47     RegisteredKeys: RegisteredKey[];
48     RegistrationOptions: RegistrationOptions;
49     AttestationFormats: AttestationFormat[];
52 export interface RegisterCredentialsPayload {
53     RegistrationOptions: RegistrationOptions;
54     ClientData: string;
55     AttestationObject: string;
56     Transports: string[];
57     Name: string;
60 export interface AuthenticationCredentialsPayload {
61     AuthenticationOptions: AuthenticationOptions;
62     ClientData: string;
63     AuthenticatorData: string;
64     Signature: string;
65     CredentialID: number[];