diff options
author | Eiji Kitamura <agektmr@google.com> | 2022-05-18 19:35:02 +0900 |
---|---|---|
committer | Eiji Kitamura <agektmr@google.com> | 2022-07-19 15:04:32 +0900 |
commit | 152d00c2f27f6bad53ed52734d74421dbfc65b53 (patch) | |
tree | 74edcf3113f95b9ad49c189689c1ba5674fbeb86 /packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts | |
parent | cfa689214f772a6375dcc385714982209ddf1f08 (diff) |
Temporary
Diffstat (limited to 'packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts')
-rw-r--r-- | packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts b/packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts new file mode 100644 index 0000000..0f0bd75 --- /dev/null +++ b/packages/server/src/extensions/decodeAttObjForDevicePublicKey.ts @@ -0,0 +1,17 @@ +import cbor from 'cbor'; +import { AttestationFormat, AttestationStatement } from '../helpers/decodeAttestationObject'; + +export default function decodeAttObjForDevicePublicKey(attObjForDevicePublicKey: Buffer): AttObjForDevicePublicKey { + const toCBOR: AttObjForDevicePublicKey = cbor.decodeAllSync(attObjForDevicePublicKey)[0]; + return toCBOR; +} + +export type AttObjForDevicePublicKey = { + sig: Buffer; + aaguid: Buffer; + dpk: Buffer; + scope: number; + nonce: Buffer; + fmt: AttestationFormat; + attStmt: AttestationStatement; +}; |