def validate_yubikey_with_aead(hsm, from_key, aead, key_handle):
from_key = pyhsm.util.input_validate_str(from_key, '<STR_LIT>', max_len = <NUM_LIT>)<EOL>nonce = aead.nonce<EOL>aead = pyhsm.util.input_validate_aead(aead)<EOL>key_handle = pyhsm.util.input_validate_key_handle(key_handle)<EOL>public_id, otp = split_id_otp(from_key)<EOL>public_id = modhex_decode(public_id)<EOL>otp = modhex_decode(otp)<EOL>if not nonce:<EOL><INDENT>nonce = public_id.decode('<STR_LIT>')<EOL><DEDENT>return hsm.validate_aead_otp(nonce, otp.decode('<STR_LIT>'),<EOL>key_handle, aead)<EOL>
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.

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

Will only return on succesfull validation. All failures will result
in an L{pyhsm.exception.YHSM_CommandFailed}.

@param hsm: The YHSM instance
@param from_key: The OTP from a YubiKey (in modhex)
@param aead: AEAD containing the cryptographic key and permission flags
@param key_handle: The key handle that can decrypt the AEAD
@type hsm: L{pyhsm.YHSM}
@type from_key: string
@type aead: L{YHSM_GeneratedAEAD} or string
@type key_handle: integer or string

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

@see: L{pyhsm.validate_cmd.YHSM_Cmd_AEAD_Validate_OTP.parse_result}