summaryrefslogtreecommitdiffhomepage
path: root/src/types.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-18 17:52:06 -0700
committerMatthew Miller <matthew@millerti.me>2020-05-18 17:52:06 -0700
commit6d086ecb8bbe6e382bf3960a3b0757489a38e78a (patch)
treec7502fa004b8dd78d16bd19cbb0a77d29a3af464 /src/types.ts
parent3cd5df6f64f070c55190ecae4ba978ac4746dd10 (diff)
Add more helpers and types
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/types.ts b/src/types.ts
index f3993da..927cdf4 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -28,13 +28,40 @@ export type AttestationObject = {
fmt: ATTESTATION_FORMATS,
attStmt: {
sig?: Buffer,
- x5c?: Buffer,
+ x5c?: Buffer[],
},
authData: Buffer,
};
+export type ParsedAttestationAuthData = {
+ rpIdHash: Buffer,
+ flagsBuf: Buffer,
+ flags: {
+ up: boolean,
+ uv: boolean,
+ at: boolean,
+ ed: boolean,
+ flagsInt: number,
+ },
+ counter: number,
+ counterBuf: Buffer,
+ aaguid?: Buffer,
+ credentialID?: Buffer,
+ COSEPublicKey?: Buffer,
+};
+
export type ClientDataJSON = {
- type: string;
- challenge: string;
- origin: string;
+ type: string,
+ challenge: string,
+ origin: string,
+};
+
+export type VerifiedAttestation = {
+ verified: boolean,
+ authenticatorInfo?: {
+ fmt: ATTESTATION_FORMATS,
+ counter: number,
+ base64PublicKey: string,
+ base64CredentialID: string,
+ },
};