@staticmethod<EOL><INDENT>@return_false_on_exception<EOL>def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='<STR_LIT>', validatecert=False, debug=False):<DEDENT>
if xml is None or xml == '<STR_LIT>':<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>elem = OneLogin_Saml2_XML.to_etree(xml)<EOL>xmlsec.enable_debug_trace(debug)<EOL>xmlsec.tree.add_ids(elem, ["<STR_LIT>"])<EOL>signature_nodes = OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>if len(signature_nodes) == <NUM_LIT:0>:<EOL><INDENT>signature_nodes += OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>if len(signature_nodes) == <NUM_LIT:0>:<EOL><INDENT>signature_nodes += OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>signature_nodes += OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL><DEDENT><DEDENT>if len(signature_nodes) > <NUM_LIT:0>:<EOL><INDENT>for signature_node in signature_nodes:<EOL><INDENT>OneLogin_Saml2_Utils.validate_node_sign(signature_node, elem, cert, fingerprint, fingerprintalg, validatecert, debug, raise_exceptions=True)<EOL><DEDENT>return True<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>
Validates a signature of a EntityDescriptor.

:param xml: The element we should validate
:type: string | Document

:param cert: The public cert
:type: string

:param fingerprint: The fingerprint of the public cert
:type: string

:param fingerprintalg: The algorithm used to build the fingerprint
:type: string

:param validatecert: If true, will verify the signature and if the cert is valid.
:type: bool

: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