일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- css
- SwiftUI
- WebAuthn
- 앱스토어
- appres
- apple
- 2FA
- FIDO2
- 앱리소스
- 애플
- MSYS2
- otpkey
- Nodejs
- Android
- MFA
- SSL
- kmip
- SWIFT
- 인증
- albumbook
- MYSQL
- git
- openssl
- SSH
- 앨범북
- 안드로이드
- fido
- OTP
- OSX
- Xcode
Archives
- Today
- Total
인디노트
How to parse the attestationObject in Node.js 본문
// this is your attestationObject which is web safe base64 encode string
var attestationObject = "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVjE4mQ5WmgO3yl24XjxRqkP9LjqRYP-GsIubALB-5K_CK5FXMrOUa3OAAI1vMYKZIsLJfHwVQMAQABcapsmHtrsLJtfZ7RDcRm0iDgMlc5-CuP2XcNOwDy0uU2mU44ENk-EqtthH7huq8AipYfY0EvmfPRqQI-zI5GlAQIDJiABIVggZplpmQSKsJvg78INyrQUgBo9dv0vaZL6Qp15rOd6wMQiWCAx-ZeQ6T_xTMlY9cG3EWY54wT9Hd6EX7P7Ak-9uwauCA";
// need to convert to base64 encode string
attestationObject = attestationObject.replace(/\-/g, '+').replace(/_/g, '/') + '=='.substring(0, (3*attestationObject.length)%4);
// do a base64 decode
var attCbor = new Buffer(attestationObject, 'base64');
// decode to have CBOR object, using cbor module
const cbor = require("cbor");
var attCborObj = cbor.decodeAllSync(attCbor)[0];
console.log(attCborObj);
반응형
'인증기술 > 보안기술' 카테고리의 다른 글
HMAC (Hash-based Message Authentication Code) (0) | 2021.07.02 |
---|---|
Q#에서 퀀텀 난수 생성기 구현 (0) | 2021.07.02 |
SSH Private Key 패스워드 없애기 (0) | 2021.05.30 |
TLS 오버 헤드 (0) | 2018.12.19 |
GSM협회 IoT자료 (0) | 2018.10.11 |