Created
October 11, 2015 20:22
-
-
Save Franzaine/f6f14361eb4132799bc7 to your computer and use it in GitHub Desktop.
Fetching APDU for generating TOTP code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void communicateWithCard(IsoCard isoCard) { | |
try { | |
isoCard.connect(); | |
Apdu.transceiveAndRequireOk(Apdu.select(OTP_AID), isoCard); | |
setMainMessage("Select OK"); | |
long timeStamp = getTimeStamp(); | |
byte[] totpCodeApdu = Otp.totpCodeApdu(TOTP_CODE_NAME, timeStamp); | |
isoCard.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment