An U2F Token implementation based on JavaCard This U2F Token: https://github.com/LedgerHQ/ledger-u2f-javacard cannot pass the NFC self-conformance test in the phase: "U2F_REGISTER, Short APDU, Change BlockSize", as it doesn't handle the situation which Le(BlockSize) is not 256 bytes. My implementation can handle of this case nicely and pass the test.
Install(Use JCOP Shell Command)
- Complie this Applet and upload to the JavaCard(>3.0)
- Set the attestation certificate(with Extended APDU, CLA:F0, INS:01, P1,P2:00, Lc:000119):
- Set the attestation private key(CLA:F0, INS:02, P1,P2:00):
U2F Self-Comformance Test
- Please access the NFC self-conformance test tool here: https://github.com/google/u2f-ref-code/tree/master/u2f-tests/NFC
- Download the newly Android Google Authenticator
- Open https://crxjs-dot-u2fdemo.appspot.com/ or https://demo.yubico.com/u2f with the newly Android chrome.
- Do the Register and Authenticate
Some Tips For Implementation
- The authenticate private key is stored in the SE, as there is enough memory to hold thousands of keys.
- The key handle consists with index(first 2 bytes) of the authenticate private key and Sha-256 appid(left 32 bytes)
- The database which stores anthenticate private keys can not increase dynamicly now.
- I also want to implement a "wrapped" key handle rather than storing the authenticate private key locally in SE.