-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegrity.ts
23 lines (22 loc) · 990 Bytes
/
integrity.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Interface for the integrity context which provides the necessary functions to interact with the integrity service.
* The functions are platform specific and must be implemented in the platform specific code.
* getHardwareKeyTag: returns the hardware key tag in a url safe format (e.g. base64url).
* getAttestation: requests the attestation from the integrity service.
* getHardwareSignatureWithAuthData: signs the clientData and returns the signature with the authenticator data.
*/
export interface IntegrityContext {
getHardwareKeyTag: () => string;
getAttestation: (nonce: string) => Promise<string>;
getHardwareSignatureWithAuthData: (
clientData: string
) => Promise<HardwareSignatureWithAuthData>;
}
/**
* Type returned by the getHardwareSignatureWithAuthData function of {@link IntegrityContext}.
* It contains the signature and the authenticator data.
*/
export type HardwareSignatureWithAuthData = {
signature: string;
authenticatorData: string;
};