Base class for accessing a YubiHSM.
|
__init__(self,
device,
debug=False,
timeout=1) |
|
|
|
|
bool
|
reset(self,
test_sync=True)
Perform stream resynchronization. |
|
|
bool
|
|
string
|
echo(self,
data)
Echo test. |
|
|
YHSM_Cmd_System_Info
|
info(self)
Get firmware version and unique ID from YubiHSM. |
|
|
string
|
random(self,
num_bytes)
Get random bytes from YubiHSM. |
|
|
bool
|
random_reseed(self,
seed)
Provide YubiHSM DRBG_CTR with a new seed. |
|
|
YHSM_NonceResponse
|
get_nonce(self,
increment=1)
Get current nonce from YubiHSM. |
|
|
bool
|
load_temp_key(self,
nonce,
key_handle,
aead)
Load the contents of an AEAD into the phantom key handle 0xffffffff. |
|
|
bool
|
unlock(self,
password=None,
otp=None)
Unlock the YubiHSM using the master key and/or a YubiKey OTP. |
|
|
|
|
integer
|
load_secret(self,
secret)
Ask YubiHSM to load a pre-existing YubiKey secret. |
|
|
integer
|
load_data(self,
data,
offset)
Ask YubiHSM to load arbitrary data into it's internal buffer, at any
offset. |
|
|
integer
|
load_random(self,
num_bytes,
offset=0)
Ask YubiHSM to generate a number of random bytes to any offset of
it's internal buffer. |
|
|
YHSM_GeneratedAEAD
|
generate_aead_simple(self,
nonce,
key_handle,
data)
Generate AEAD block from data for a specific key in a single step
(without using the YubiHSM internal buffer). |
|
|
YHSM_GeneratedAEAD
|
generate_aead_random(self,
nonce,
key_handle,
num_bytes)
Generate a random AEAD block using the YubiHSM internal DRBG_CTR
random generator. |
|
|
YHSM_GeneratedAEAD
|
|
bool
|
validate_aead(self,
nonce,
key_handle,
aead,
cleartext)
Validate the contents of an AEAD using the YubiHSM. |
|
|
YHSM_ValidationResult
|
validate_aead_otp(self,
public_id,
otp,
key_handle,
aead)
Ask YubiHSM to validate a YubiKey OTP using an AEAD and a key_handle
to decrypt the AEAD. |
|
|
NoneType
|
monitor_exit(self)
Ask YubiHSM to exit to configuration mode (requires 'debug' mode
enabled). |
|
|
Serial
|
|
bool
|
drain(self)
Read until there is nothing more to be read. |
|
|
string
|
aes_ecb_encrypt(self,
key_handle,
plaintext)
AES ECB encrypt using a key handle. |
|
|
string
|
aes_ecb_decrypt(self,
key_handle,
ciphertext)
AES ECB decrypt using a key handle. |
|
|
bool
|
aes_ecb_compare(self,
key_handle,
ciphertext,
plaintext)
AES ECB decrypt and then compare using a key handle. |
|
|
YHSM_Cmd_HMAC_SHA1_Write
|
hmac_sha1(self,
key_handle,
data,
flags=None,
final=True,
to_buffer=False)
Have the YubiHSM generate a HMAC SHA1 of 'data' using a key handle. |
|
|
bool
|
db_store_yubikey(self,
public_id,
key_handle,
aead)
Ask YubiHSM to store data about a YubiKey in the internal database
(not buffer). |
|
|
YHSM_ValidationResult
|
db_validate_yubikey_otp(self,
public_id,
otp)
Request the YubiHSM to validate an OTP for a YubiKey stored in the
internal database. |
|
|