Skip to content

Instantly share code, notes, and snippets.

@gebogebogebo
Last active September 28, 2019 12:28
Show Gist options
  • Save gebogebogebo/c4f8a36abcb59eabfc1a6f63bbd5c96f to your computer and use it in GitHub Desktop.
Save gebogebogebo/c4f8a36abcb59eabfc1a6f63bbd5c96f to your computer and use it in GitHub Desktop.
CTAP2 お勉強メモ#4 - 認証(Authentication) ref: https://qiita.com/gebo/items/634aa39b0e08d8258682
{
// 0x01:credential
1: {
"id": h'C52D9FDEBA951F4ACA94C2CB7DCFB47B13D0E4D676E2491F90D081D65E6995C74A77828BF8DFE239FC1D62D93DDB547827C524A2A3C035A27D4041DB8352F87E',
"type": "public-key"
},
// 0x02:authData
2: h'49960DE5880E8C687434170F6476605B8FE4AEB9A28632C7995CF3BA831D97630000000068',
// 0x03:signature
3: h'3044022065E5E681837AEDE320D601BE7F82533976F437A5A1066B12EB4D1CAE870E7C32022035E160160AE4B014B81EDA0C264F1F8863A5D5C600EE8B482AB10E52DAC690CB'
}
// 0x01 rpid
1: "localhost",
// 0x02 clientDataHash
2: h'EC8D8F78424A2BB78234AACA07A1F656421CB6F6B3008652352DA2624ABE8976',
// 0x03 allowList
3: [{
"type": "public-key",
"id": h'C52D9FDEBA951F4ACA94C2CB7DCFB47B13D0E4D676E2491F90D081D65E6995C74A77828BF8DFE239FC1D62D93DDB547827C524A2A3C035A27D4041DB8352F87E'
}],
// 0x05 options
5: {"up": false, "uv": false}
>assert.exe -a c:\work\cred_out\creid.dat c:\work\cred_out\pubkey.pem \\?\hid#vid_1050&pid_0120#6&1b5e4874&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
c:\work\assert>certutil -f -decodehex assert_sig.hex assert_sig.bin 4
入力長 = 140
出力長 = 70
CertUtil: -decodehex コマンドは正常に完了しました。
c:\work\assert>certutil -f -decodehex assert_dgst.hex assert_dgst.bin 4
入力長 = 138
出力長 = 69
CertUtil: -decodehex コマンドは正常に完了しました。
c:\work\assert>openssl dgst -sha256 -verify cred_pubkey.pem -signature assert_sig.bin assert_dgst.bin
Verified OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment