@staticmethod<EOL><INDENT>@return_false_on_exception<EOL>def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA1, debug=False):<DEDENT>
error_callback_method = None<EOL>if debug:<EOL><INDENT>error_callback_method = print_xmlsec_errors<EOL><DEDENT>xmlsec.set_error_callback(error_callback_method)<EOL>dsig_ctx = xmlsec.DSigCtx()<EOL>file_cert = OneLogin_Saml2_Utils.write_temp_file(cert)<EOL>dsig_ctx.signKey = xmlsec.Key.load(file_cert.name, xmlsec.KeyDataFormatCertPem, None)<EOL>file_cert.close()<EOL>sign_algorithm_transform_map = {<EOL>OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.TransformDsaSha1,<EOL>OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.TransformRsaSha1,<EOL>OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.TransformRsaSha256,<EOL>OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.TransformRsaSha384,<EOL>OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.TransformRsaSha512<EOL>}<EOL>sign_algorithm_transform = sign_algorithm_transform_map.get(algorithm, xmlsec.TransformRsaSha1)<EOL>dsig_ctx.verifyBinary(signed_query, sign_algorithm_transform, signature)<EOL>return True<EOL>
Validates signed binary data (Used to validate GET Signature).

:param signed_query: The element we should validate
:type: string


:param signature: The signature that will be validate
:type: string

:param cert: The public cert
:type: string

:param algorithm: Signature algorithm
:type: string

:param debug: Activate the xmlsec debug
:type: bool

:param raise_exceptions: Whether to return false on failure or raise an exception
:type raise_exceptions: Boolean