category | OSS |
---|---|
package | OSS_Yubico |
copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland |
license | New BSD License |
aes128EcbDecrypt(string $cipherText, string $key) : string
string
the encrypted string, a string of hexadecimal values
string
the AES key, a string of hexadecimal values
string
a string of hexadecimal valuescrc16(string $string) : string
string
string
the CRC16 value as a hexadecimal numbergetErrorMessage(int $errorCode) : string
int
Eror code is negative value from one to eight
string
hex2base64(string $hex) : string
string
string
hex2bin(string $hex) : string
string
string
hex2modhex(string $hex) : string
string
string
isCrcGood(string $string) : bool
string
bool
modhex2base64(string $modHex) : string
string
string
modhex2hex($modHex) : string
string
validate(string $pOTP) : array | integer
Checks it against rules and the database, too. Returns with an associative array containing the following fields (extracted from the OTP): secret_id, session_counter, session_use, clock, random Retruns with a negative integer on error.
-1: No OTP provided -2: Corrupt OTP -3: DB failure while trying to read user data -4: User does not exist -5: Wrong AES key -6: User ID mismatch -7: Replay attack -8: DB failure while trying to update user data
string
array
integer
array on success, negative integer on error$VALIDATION_ERROR : array
ERR_CORRUPT_OTP
ERR_DATABASE_READ
ERR_DATABASE_WRITE
ERR_NO_OTP_PROVIDED
ERR_NO_SUCH_USER
ERR_REPLAY_ATTACK
ERR_USER_ID_MISMATCH
ERR_WRONG_AES_KEY