public class Pof
extends java.lang.Object
Utility methods of use when decryption and parsing of YubiKey One Time Passwords (OTPs).
public static Token parse(java.lang.String block, byte[] key) throws java.security.GeneralSecurityException
Decrypt and parse YubiKey OTP.
block
- Modhex
encoded representation of the YubiKey OTP.key
- 128 bit AES key used to encrypt block
, now will be
used to ecrypt.java.security.GeneralSecurityException
- If decryption fails.public static byte[] decrypt(byte[] key, byte[] decoded) throws java.security.GeneralSecurityException
Does AES encryption of a YubiKey OTP byte sequence.
key
- AES key.decoded
- YubiKey OTP byte sequence,
Modhex.decode(String)
is the typical producer of
this.java.security.GeneralSecurityException
- If decryption fails.