summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-19 01:04:26 -0700
committerMatthew Miller <matthew@millerti.me>2020-05-19 01:04:26 -0700
commit2f5ecb1e7fcafbf5bca9009bea9f06c59703788d (patch)
tree25a20bc422c70e630b3e134bcd6d3bc83a2e960e /src
parent1af9b98d689d623e4ecc9593d24cbb8621120222 (diff)
Clarify usage of decodeAttestationObject
Diffstat (limited to 'src')
-rw-r--r--src/helpers/decodeAttestationObject.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/helpers/decodeAttestationObject.ts b/src/helpers/decodeAttestationObject.ts
index 1c353d9..c54a69a 100644
--- a/src/helpers/decodeAttestationObject.ts
+++ b/src/helpers/decodeAttestationObject.ts
@@ -4,11 +4,14 @@ import cbor from 'cbor';
import { AttestationObject } from '@types';
/**
+ * Convert an AttestationObject from base64 string to a proper object
*
- * @param obj
+ * @param base64AttestationObject Base64-encoded Attestation Object
*/
-export default function decodeAttestationObject(obj: string): AttestationObject {
- const toBuffer = base64url.toBuffer(obj);
- const toCBOR = cbor.decodeAllSync(toBuffer)[0];
+export default function decodeAttestationObject(
+ base64AttestationObject: string,
+): AttestationObject {
+ const toBuffer = base64url.toBuffer(base64AttestationObject);
+ const toCBOR: AttestationObject = cbor.decodeAllSync(toBuffer)[0];
return toCBOR;
}