Module Expr Str Assign NameStore ListLoad Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Assign AttributeStore NameLoad attr NameLoad If Call AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr keyword NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr If CompareNotEq AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr body Raise Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return CompareEq NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIsNot Call NameLoad NameLoad NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr ListComp Call NameLoad NameLoad comprehension NameStore Call NameLoad Num Assign NameStore BinOpAdd NameLoad Call AttributeLoad Str attr Str Assign NameStore BinOpSub AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Num While NameLoad body Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body If CompareNotEq SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore BinOpMod Str TupleLoad BinOpAdd NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Raise Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AugAssignAdd NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If BoolOpAnd CompareIsNot NameLoad NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIsNot NameLoad NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr orelse If Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr orelse Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str orelse Assign NameStore NameLoad If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If CompareIsNot Call NameLoad NameLoad NameLoad body Assert TupleLoad If CompareIsNot Call NameLoad NameLoad NameLoad body Assert TupleLoad If CompareIsNot Call NameLoad NameLoad NameLoad body Assert TupleLoad If CompareIsNot Call NameLoad NameLoad NameLoad body Assert TupleLoad Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryFinally body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Return Call AttributeLoad AttributeLoad NameLoad attr attr finalbody Expr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpAnd CompareIsNot NameLoad NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad keyword NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad attr decorator_list decorator_list
N/A N/A 
module for accessing a YubiHSM
 N/A __all__ N/A YHSM N/A pyhsm.cmd N/A pyhsm.stick N/A pyhsm.stick_client N/A pyhsm.exception N/A pyhsm.version N/A pyhsm.aead_cmd N/A pyhsm.aes_ecb_cmd N/A pyhsm.basic_cmd N/A pyhsm.buffer_cmd N/A pyhsm.db_cmd N/A pyhsm.debug_cmd N/A pyhsm.hmac_cmd N/A pyhsm.validate_cmd N/A pyhsm.yubikey N/A pyhsm.soft_hsm YHSM N/A N/A N/A 
    Base class for accessing a YubiHSM.
     __init__ N/A N/A self device debug timeout test_comm N/A False 1 True N/A N/A N/A self debug debug N/A N/A N/A device startswith yhsm:// N/A N/A N/A self stick N/A N/A N/A pyhsm stick_client YHSM_Stick_Client device N/A N/A N/A self stick N/A N/A N/A pyhsm stick YHSM_Stick device debug N/A self debug timeout timeout N/A N/A N/A N/A self reset test_sync False N/A N/A N/A N/A N/A pyhsm exception YHSM_Error Initialization of YubiHSM failed N/A N/A self version N/A N/A N/A pyhsm version YHSM_Version N/A N/A self info N/A N/A N/A N/A N/A self version sysinfo protocol_ver N/A N/A pyhsm defines YSM_PROTOCOL_VERSION N/A N/A N/A N/A N/A pyhsm exception YHSM_Error N/A Unknown YubiHSM protocol version (%i, I speak %i) N/A N/A N/A N/A self version sysinfo protocol_ver N/A N/A pyhsm defines YSM_PROTOCOL_VERSION N/A test_comm N/A N/A N/A N/A self test_comm N/A None N/A __repr__ N/A N/A self N/A N/A N/A N/A <%s instance at %s: %s> N/A N/A N/A self __class__ __name__ N/A hex N/A id self N/A N/A self stick device N/A reset N/A N/A self test_sync N/A True N/A N/A 
        Perform stream resynchronization.

        @param test_sync: Verify sync with YubiHSM after reset
        @type test_sync: bool

        @return: True if successful
        @rtype: bool
         N/A N/A N/A N/A pyhsm cmd reset N/A self stick N/A test_sync N/A N/A data ekoeko N/A echo N/A N/A self echo data N/A N/A data echo N/A N/A True N/A set_debug N/A N/A self new N/A N/A N/A 
        Set debug mode.

        @param new: new value
        @type new: bool

        @return: old value
        @rtype: bool
         N/A N/A N/A type new bool N/A N/A N/A N/A N/A pyhsm exception YHSM_WrongInputType new bool N/A type new N/A old N/A self debug N/A N/A self debug new N/A N/A N/A N/A self stick set_debug new N/A old N/A test_comm N/A N/A self N/A N/A N/A 
        Verify that data we send to and receive from the YubiHSM isn't mangled.

        In some scenarios, communications with the YubiHSM might be affected
        by terminal line settings turning CR into LF for example.
         N/A data N/A N/A join N/A N/A chr x N/A x N/A range 256 N/A data N/A data N/A N/A 0d0a0d0a decode hex N/A chunk_size N/A N/A N/A pyhsm defines YSM_MAX_PKT_SIZE 10 N/A count 0 N/A data N/A N/A this N/A data N/A chunk_size N/A data N/A data N/A chunk_size N/A res N/A N/A self echo this N/A i N/A xrange N/A len this N/A N/A N/A N/A res N/A i N/A this N/A i N/A N/A msg N/A Echo test failed at position %i (0x%x != 0x%x) N/A N/A count i N/A ord N/A res N/A i N/A ord N/A this N/A i N/A N/A N/A N/A pyhsm exception YHSM_Error msg N/A count N/A len this N/A echo N/A N/A self data N/A N/A N/A 
        Echo test.

        @type data: string
        @return: data read from YubiHSM -- should equal `data'
        @rtype: string

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Echo}
         N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Echo N/A self stick data execute N/A info N/A N/A self N/A N/A N/A  Get firmware version and unique ID from YubiHSM.

        @return: System information
        @rtype: L{YHSM_Cmd_System_Info}

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_System_Info}
         N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_System_Info N/A self stick execute N/A random N/A N/A self num_bytes N/A N/A N/A 
        Get random bytes from YubiHSM.

        The random data is DRBG_CTR seeded on each startup by a hardware TRNG,
        so it should be of very good quality.

        @type num_bytes: integer

        @return: Bytes with random data
        @rtype: string

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Random}
         N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Random N/A self stick num_bytes execute N/A random_reseed N/A N/A self seed N/A N/A N/A 
        Provide YubiHSM DRBG_CTR with a new seed.

        @param seed: new seed -- must be exactly 32 bytes
        @type seed: string

        @returns: True on success
        @rtype: bool

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Random_Reseed}
         N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Random_Reseed N/A self stick seed execute N/A get_nonce N/A N/A self increment N/A 1 N/A N/A 
        Get current nonce from YubiHSM.

        Use increment 0 to just fetch the value without incrementing it.

        @keyword increment: requested increment (optional)

        @return: nonce value _before_ increment
        @rtype: L{YHSM_NonceResponse}

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Nonce_Get}
        N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Nonce_Get N/A self stick increment execute N/A load_temp_key N/A N/A self nonce key_handle aead N/A N/A N/A 
        Load the contents of an AEAD into the phantom key handle 0xffffffff.

        @param nonce: The nonce used when creating the AEAD
        @param key_handle: The key handle that can decrypt the AEAD
        @param aead: AEAD containing the cryptographic key and permission flags
        @type nonce: string
        @type key_handle: integer or string
        @type aead: L{YHSM_GeneratedAEAD} or string

        @returns: True on success
        @rtype: bool

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Temp_Key_Load}
         N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Temp_Key_Load N/A self stick nonce key_handle aead execute N/A unlock N/A N/A self password otp N/A None None N/A N/A 
        Unlock the YubiHSM using the master key and/or a YubiKey OTP.

        If the master key is given during configuration, all key handles will be
        encrypted (with AES-256) using that passphrase.

        If one or more admin Yubikey public id's are given during configuration,
        an OTP from one of these must be provided to the YubiHSM for it to start
        responding to cryptographic requests. The admin YubiKeys must be present
        in the internal database for this validation to work.

        @param password: The 'master key' set during YubiHSM configuration
        @type password: NoneType or string
        @param otp: A YubiKey OTP from an 'admin' YubiKey (modhex), to unlock YubiHSM.
        @type otp: NoneType or string

        @returns: Only returns (True) on success
        @rtype: bool

        @see: L{pyhsm.basic_cmd.YHSM_Cmd_Key_Storage_Unlock}
        @see: L{pyhsm.basic_cmd.YHSM_Cmd_HSM_Unlock}
         N/A N/A N/A otp None N/A N/A N/A N/A self version have_unlock N/A N/A N/A N/A N/A pyhsm exception YHSM_Error Your YubiHSM does not support OTP unlocking. N/A N/A password None N/A N/A N/A N/A N/A self version have_key_storage_unlock N/A N/A res N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Key_Storage_Unlock N/A self stick password execute N/A N/A N/A N/A N/A self version have_key_store_decrypt N/A N/A res N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_Key_Store_Decrypt N/A self stick password execute N/A N/A N/A N/A N/A pyhsm exception YHSM_Error Don't know how to unlock your YubiHSM. N/A N/A res True N/A N/A res N/A otp None N/A N/A N/A public_id otp N/A N/A N/A pyhsm yubikey split_id_otp otp N/A public_id N/A N/A N/A N/A N/A pyhsm yubikey modhex_decode public_id decode hex N/A otp N/A N/A N/A N/A N/A pyhsm yubikey modhex_decode otp decode hex N/A N/A N/A N/A N/A N/A pyhsm basic_cmd YHSM_Cmd_HSM_Unlock N/A self stick public_id otp execute N/A res N/A key_storage_unlock N/A N/A self password N/A N/A N/A 
        @deprecated: Too specific (and hard to remember) name.
        @see: L{unlock}
         N/A N/A N/A self unlock password password N/A load_secret N/A N/A self secret N/A N/A N/A 
        Ask YubiHSM to load a pre-existing YubiKey secret.

        The data is stored internally in the YubiHSM in temporary memory -
        this operation would typically be followed by one or more L{generate_aead}
        commands to actually retreive the generated secret (in encrypted form).

        @param secret: YubiKey secret to load
        @type secret: L{pyhsm.aead_cmd.YHSM_YubiKeySecret} or string

        @returns: Number of bytes in YubiHSM internal buffer after load
        @rtype: integer

        @see: L{pyhsm.buffer_cmd.YHSM_Cmd_Buffer_Load}
         N/A N/A isinstance secret N/A N/A pyhsm aead_cmd YHSM_YubiKeySecret N/A N/A secret N/A N/A secret pack N/A N/A N/A N/A N/A N/A pyhsm buffer_cmd YHSM_Cmd_Buffer_Load N/A self stick secret execute N/A load_data N/A N/A self data offset N/A N/A N/A 
        Ask YubiHSM to load arbitrary data into it's internal buffer, at any offset.

        The data is stored internally in the YubiHSM in temporary memory -
        this operation would typically be followed by one or more L{generate_aead}
        commands to actually retreive the generated secret (in encrypted form).

        Load data to offset 0 to reset the buffer.

        @param data: arbitrary data to load
        @type data: string

        @returns: Number of bytes in YubiHSM internal buffer after load
        @rtype: integer

        @see: L{pyhsm.buffer_cmd.YHSM_Cmd_Buffer_Load}
         N/A N/A N/A N/A N/A N/A pyhsm buffer_cmd YHSM_Cmd_Buffer_Load N/A self stick data offset execute N/A load_random N/A N/A self num_bytes offset N/A 0 N/A N/A 
        Ask YubiHSM to generate a number of random bytes to any offset of it's internal
        buffer.

        The data is stored internally in the YubiHSM in temporary memory -
        this operation would typically be followed by one or more L{generate_aead}
        commands to actually retreive the generated secret (in encrypted form).

        @param num_bytes: Number of bytes to generate
        @type num_bytes: integer

        @returns: Number of bytes in YubiHSM internal buffer after load
        @rtype: integer

        @see: L{pyhsm.buffer_cmd.YHSM_Cmd_Buffer_Random_Load}
         N/A N/A N/A N/A N/A N/A pyhsm buffer_cmd YHSM_Cmd_Buffer_Random_Load N/A self stick num_bytes offset execute N/A generate_aead_simple N/A N/A self nonce key_handle data N/A N/A N/A 
        Generate AEAD block from data for a specific key in a single step
        (without using the YubiHSM internal buffer).

        @param nonce: The nonce to use when creating the AEAD
        @param key_handle: The key handle that can encrypt data into an AEAD
        @param data: Data to put inside the AEAD
        @type nonce: string
        @type key_handle: integer or string
        @type data: string

        @returns: The generated AEAD on success.
        @rtype: L{YHSM_GeneratedAEAD}

        @see: L{pyhsm.aead_cmd.YHSM_Cmd_AEAD_Generate}
         N/A N/A N/A N/A N/A N/A pyhsm aead_cmd YHSM_Cmd_AEAD_Generate N/A self stick nonce key_handle data execute N/A generate_aead_random N/A N/A self nonce key_handle num_bytes N/A N/A N/A 
        Generate a random AEAD block using the YubiHSM internal DRBG_CTR random generator.

        To generate a secret for a YubiKey, use public_id as nonce.

        @param nonce: The nonce to use when creating the AEAD
        @param key_handle: The key handle that can encrypt the random data into an AEAD
        @param num_bytes: Number of random data bytes to put inside the AEAD
        @type nonce: string
        @type key_handle: integer or string
        @type num_bytes: integer

        @returns: The generated AEAD on success.
        @rtype: L{YHSM_GeneratedAEAD}

        @see: L{pyhsm.aead_cmd.YHSM_Cmd_AEAD_Random_Generate}
         N/A N/A N/A N/A N/A N/A pyhsm aead_cmd YHSM_Cmd_AEAD_Random_Generate N/A self stick nonce key_handle num_bytes execute N/A generate_aead N/A N/A self nonce key_handle N/A N/A N/A 
        Ask YubiHSM to return an AEAD made of the contents of it's internal buffer
        (see L{load_secret}, L{load_data} and L{load_random}) encrypted with the specified key_handle.

        For a YubiKey secret, the nonce should be the public_id.

        @param nonce: The nonce to use when creating the AEAD
        @param key_handle: The key handle that can create an AEAD
        @type nonce: string
        @type key_handle: integer or string

        @returns: The generated AEAD on success.
        @rtype: L{YHSM_GeneratedAEAD}

        @see: L{pyhsm.aead_cmd.YHSM_Cmd_AEAD_Buffer_Generate}
         N/A N/A N/A N/A N/A N/A pyhsm aead_cmd YHSM_Cmd_AEAD_Buffer_Generate N/A self stick nonce key_handle execute N/A validate_aead N/A N/A self nonce key_handle aead cleartext N/A N/A N/A 
        Validate the contents of an AEAD using the YubiHSM. The matching is done
        inside the YubiHSM so the contents of the AEAD is never exposed (well,
        except indirectionally when the cleartext does match).

        The cleartext should naturally be of the same length as the AEAD minus
        the size of the MAC (8 bytes).

        @param nonce: The nonce used when creating the AEAD
        @param key_handle: The key handle that can decrypt the AEAD
        @param aead: AEAD containing the cryptographic key and permission flags
        @param cleartext: The presumed cleartext of the AEAD
        @type nonce: string
        @type key_handle: integer or string
        @type aead: L{YHSM_GeneratedAEAD} or string
        @type cleartext: string

        @returns: Whether or not the cleartext matches the contents of the AEAD.
        @rtype: bool

        @see: L{pyhsm.aead_cmd.YHSM_Cmd_AEAD_Decrypt_Cmp}
         N/A N/A N/A N/A N/A N/A pyhsm aead_cmd YHSM_Cmd_AEAD_Decrypt_Cmp N/A self stick nonce key_handle aead cleartext execute N/A validate_aead_otp N/A N/A self public_id otp key_handle aead N/A N/A N/A 
        Ask YubiHSM to validate a YubiKey OTP using an AEAD and a key_handle to
        decrypt the AEAD.

        @param public_id: The six bytes public id of the YubiKey
        @param otp: The one time password (OTP) to validate
        @param key_handle: The key handle that can decrypt the AEAD
        @param aead: AEAD containing the cryptographic key and permission flags
        @type public_id: string
        @type otp: string
        @type key_handle: integer or string
        @type aead: L{YHSM_GeneratedAEAD} or string

        @returns: validation response
        @rtype: L{YHSM_ValidationResult}

        @see: L{pyhsm.validate_cmd.YHSM_Cmd_AEAD_Validate_OTP}
         N/A N/A N/A type public_id str N/A N/A N/A N/A N/A N/A type otp str N/A N/A N/A N/A N/A N/A type key_handle int N/A N/A N/A N/A N/A N/A type aead str N/A N/A N/A N/A N/A N/A N/A N/A N/A pyhsm validate_cmd YHSM_Cmd_AEAD_Validate_OTP N/A self stick public_id otp key_handle aead execute N/A monitor_exit N/A N/A self N/A N/A N/A 
        Ask YubiHSM to exit to configuration mode (requires 'debug' mode enabled).

        @returns: None
        @rtype: NoneType

        @see: L{pyhsm.debug_cmd.YHSM_Cmd_Monitor_Exit}
         N/A N/A N/A N/A N/A N/A pyhsm debug_cmd YHSM_Cmd_Monitor_Exit N/A self stick execute read_response False N/A get_raw_device N/A N/A self N/A N/A N/A 
        Get the raw device. Only intended for test code/debugging!

        @returns: serial device
        @rtype: Serial
         N/A N/A N/A N/A self stick raw_device N/A drain N/A N/A self N/A N/A N/A 
        Read until there is nothing more to be read. Only intended for test code/debugging!

        @returns: True on success
        @rtype: bool
         N/A N/A N/A unlock N/A N/A N/A self stick acquire N/A N/A N/A N/A self stick drain N/A N/A N/A unlock N/A aes_ecb_encrypt N/A N/A self key_handle plaintext N/A N/A N/A 
        AES ECB encrypt using a key handle.

        @warning: Please be aware of the known limitations of AES ECB mode before using it!

        @param key_handle: Key handle to use for AES ECB encryption
        @param plaintext: Data to encrypt
        @type key_handle: integer or string
        @type plaintext: string

        @returns: Ciphertext
        @rtype: string

        @see: L{pyhsm.aes_ecb_cmd.YHSM_Cmd_AES_ECB_Encrypt}
         N/A N/A N/A N/A N/A N/A pyhsm aes_ecb_cmd YHSM_Cmd_AES_ECB_Encrypt N/A self stick key_handle plaintext execute N/A aes_ecb_decrypt N/A N/A self key_handle ciphertext N/A N/A N/A 
        AES ECB decrypt using a key handle.

        @warning: Please be aware of the known limitations of AES ECB mode before using it!

        @param key_handle: Key handle to use for AES ECB decryption
        @param ciphertext: Data to decrypt
        @type key_handle: integer or string
        @type ciphertext: string

        @returns: Plaintext
        @rtype: string

        @see: L{pyhsm.aes_ecb_cmd.YHSM_Cmd_AES_ECB_Decrypt}
         N/A N/A N/A N/A N/A N/A pyhsm aes_ecb_cmd YHSM_Cmd_AES_ECB_Decrypt N/A self stick key_handle ciphertext execute N/A aes_ecb_compare N/A N/A self key_handle ciphertext plaintext N/A N/A N/A 
        AES ECB decrypt and then compare using a key handle.

        The comparison is done inside the YubiHSM so the plaintext is never exposed (well,
        except indirectionally when the provided plaintext does match).

        @warning: Please be aware of the known limitations of AES ECB mode before using it!

        @param key_handle: Key handle to use for AES ECB decryption
        @param plaintext: Data to decrypt
        @type key_handle: integer or string
        @type plaintext: string

        @returns: Match result
        @rtype: bool

        @see: L{pyhsm.aes_ecb_cmd.YHSM_Cmd_AES_ECB_Compare}
         N/A N/A N/A N/A N/A N/A pyhsm aes_ecb_cmd YHSM_Cmd_AES_ECB_Compare N/A self stick key_handle ciphertext plaintext execute N/A hmac_sha1 N/A N/A self key_handle data flags final to_buffer N/A None True False N/A N/A 
        Have the YubiHSM generate a HMAC SHA1 of 'data' using a key handle.

        Use the L{pyhsm.hmac_cmd.YHSM_Cmd_HMAC_SHA1_Write.next} to add more input (until
        'final' has been set to True).

        Use the L{pyhsm.hmac_cmd.YHSM_Cmd_HMAC_SHA1_Write.get_hash} to get the hash result
        this far.

        @param key_handle: Key handle to use when generating HMAC SHA1
        @param data: what to calculate the HMAC SHA1 checksum of
        @keyword flags: bit-flags, overrides 'final' and 'to_buffer'
        @keyword final: True when there is no more data, False if there is more
        @keyword to_buffer: Should the final result be stored in the YubiHSM internal buffer or not
        @type key_handle: integer or string
        @type data: string
        @type flags: None or integer

        @returns: HMAC-SHA1 instance
        @rtype: L{YHSM_Cmd_HMAC_SHA1_Write}

        @see: L{pyhsm.hmac_cmd.YHSM_Cmd_HMAC_SHA1_Write}
         N/A N/A N/A N/A N/A N/A pyhsm hmac_cmd YHSM_Cmd_HMAC_SHA1_Write N/A self stick key_handle data flags flags final final to_buffer to_buffer execute N/A db_store_yubikey N/A N/A self public_id key_handle aead nonce N/A None N/A N/A 
        Ask YubiHSM to store data about a YubiKey in the internal database (not buffer).

        The input is an AEAD with the secrets of a YubiKey, perhaps previously created
        using L{load_secret}.

        @param public_id: The six bytes public id of the YubiKey
        @param key_handle: Key handle that can decrypt the YubiKey AEAD
        @param aead: AEAD of an L{pyhsm.aead_cmd.YHSM_YubiKeySecret}
        @param nonce: Nonce, if different from public_id.
        @type public_id: string
        @type key_handle: integer or string
        @type aead: L{YHSM_GeneratedAEAD} or string
        @type nonce: None or string

        @return: True on success
        @rtype: bool

        @see: L{pyhsm.db_cmd.YHSM_Cmd_DB_YubiKey_Store}
         N/A N/A N/A nonce None N/A N/A N/A N/A self version have_YSM_DB_YUBIKEY_AEAD_STORE2 N/A N/A N/A N/A N/A pyhsm exception YHSM_Error YubiHSM does not support nonce != public_id. N/A N/A N/A N/A N/A N/A pyhsm db_cmd YHSM_Cmd_DB_YubiKey_Store N/A self stick public_id key_handle aead nonce nonce execute N/A db_validate_yubikey_otp N/A N/A self public_id otp N/A N/A N/A 
        Request the YubiHSM to validate an OTP for a YubiKey stored
        in the internal database.

        @param public_id: The six bytes public id of the YubiKey
        @param otp: The OTP from a YubiKey in binary form (16 bytes)
        @type public_id: string
        @type otp: string

        @returns: validation response
        @rtype: L{YHSM_ValidationResult}

        @see: L{pyhsm.db_cmd.YHSM_Cmd_DB_Validate_OTP}
         N/A N/A N/A N/A N/A N/A pyhsm db_cmd YHSM_Cmd_DB_Validate_OTP N/A self stick public_id otp execute N/A N/A