def validate_otp(hsm, from_key):
public_id, otp = split_id_otp(from_key)<EOL>return hsm.db_validate_yubikey_otp(modhex_decode(public_id).decode('<STR_LIT>'),<EOL>modhex_decode(otp).decode('<STR_LIT>')<EOL>)<EOL>
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.

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)
@type hsm: L{pyhsm.YHSM}
@type from_key: string

@returns: validation response, if successful
@rtype: L{YHSM_ValidationResult}

@see: L{pyhsm.db_cmd.YHSM_Cmd_DB_Validate_OTP.parse_result}