public class Token
extends java.lang.Object
Represents decrypted and parsed YubiKey OTP.
Constructor and Description |
---|
Token(byte[] b)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getCleanCounter()
Gets session counter bytes with cap-lock triggered bit cleared.
|
byte[] |
getCrc()
Gets reference to the CRC16 checksum of the OTP.
|
byte[] |
getRandom()
Gets reference to the random bytes of the OTP.
|
byte[] |
getSessionCounter()
Gets reference to byte sequence of session counter.
|
byte |
getTimestampHigh()
Gets high byte of time stamp.
|
byte[] |
getTimestampLow()
Gets reference to byte sequence of low part of time stamp.
|
byte |
getTimesUsed()
Gets byte value of counter that increases for each generated OTP during
a session.
|
byte[] |
getUid()
Gets reference to bytes making up secret id.
|
java.lang.String |
toString() |
boolean |
wasCapsLockOn()
Tells if triggered by caps lock.
|
public Token(byte[] b)
Constructor.
b
- Decrypted OTP to be parsed.java.lang.IllegalArgumentException
- If b
not accepted as being a OTP.public byte[] getCrc()
Gets reference to the CRC16 checksum of the OTP.
This property is of little interest to other then unit test code since
the checksum was validated when constructing this
.
public byte[] getRandom()
Gets reference to the random bytes of the OTP.
This property is of little interest to other then unit test code.
public byte[] getUid()
Gets reference to bytes making up secret id.
public byte[] getSessionCounter()
Gets reference to byte sequence of session counter.
getCleanCounter()
public byte getTimestampHigh()
Gets high byte of time stamp.
public byte[] getTimestampLow()
Gets reference to byte sequence of low part of time stamp.
2
.public byte[] getCleanCounter()
Gets session counter bytes with cap-lock triggered bit cleared.
public byte getTimesUsed()
Gets byte value of counter that increases for each generated OTP during a session.
public boolean wasCapsLockOn()
Tells if triggered by caps lock.
true
if, false
if not.public java.lang.String toString()
toString
in class java.lang.Object