Package pyhsm :: Module yubikey
[frames] | no frames]

Module yubikey

helper functions to work with Yubikeys and YubiHSM

Functions
 
validate_otp(hsm, from_key)
Try to validate an OTP from a YubiKey using the internal database on the YubiHSM.
 
validate_yubikey_with_aead(hsm, from_key, aead, key_handle)
Try to validate an OTP from a YubiKey using the AEAD that can decrypt this YubiKey's internal secret, using the key_handle for the AEAD.
 
modhex_decode(data)
Convert a modhex string to ordinary hex.
 
modhex_encode(data)
Convert an ordinary hex string to modhex.
Function Details

validate_otp(hsm, from_key)

 

Try to validate an OTP from a YubiKey using the internal database on the YubiHSM.

`from_key' is the modhex encoded string emitted when you press the button on your YubiKey.

validate_yubikey_with_aead(hsm, from_key, aead, key_handle)

 

Try to validate an OTP from a YubiKey using the AEAD that can decrypt this YubiKey's internal secret, using the key_handle for the AEAD.

The parameter `aead' is either a string, or an instance of YHSM_GeneratedAEAD.