def process_signed_elements(self):
sign_nodes = self.__query('<STR_LIT>')<EOL>signed_elements = []<EOL>verified_seis = []<EOL>verified_ids = []<EOL>response_tag = '<STR_LIT>' % OneLogin_Saml2_Constants.NS_SAMLP<EOL>assertion_tag = '<STR_LIT>' % OneLogin_Saml2_Constants.NS_SAML<EOL>for sign_node in sign_nodes:<EOL><INDENT>signed_element = sign_node.getparent().tag<EOL>if signed_element != response_tag and signed_element != assertion_tag:<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>' % signed_element,<EOL>OneLogin_Saml2_ValidationError.WRONG_SIGNED_ELEMENT<EOL>)<EOL><DEDENT>if not sign_node.getparent().get('<STR_LIT>'):<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.ID_NOT_FOUND_IN_SIGNED_ELEMENT<EOL>)<EOL><DEDENT>id_value = sign_node.getparent().get('<STR_LIT>')<EOL>if id_value in verified_ids:<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.DUPLICATED_ID_IN_SIGNED_ELEMENTS<EOL>)<EOL><DEDENT>verified_ids.append(id_value)<EOL>ref = OneLogin_Saml2_XML.query(sign_node, '<STR_LIT>')<EOL>if ref:<EOL><INDENT>ref = ref[<NUM_LIT:0>]<EOL>if ref.get('<STR_LIT>'):<EOL><INDENT>sei = ref.get('<STR_LIT>')[<NUM_LIT:1>:]<EOL>if sei != id_value:<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.INVALID_SIGNED_ELEMENT<EOL>)<EOL><DEDENT>if sei in verified_seis:<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.DUPLICATED_REFERENCE_IN_SIGNED_ELEMENTS<EOL>)<EOL><DEDENT>verified_seis.append(sei)<EOL><DEDENT><DEDENT>signed_elements.append(signed_element)<EOL><DEDENT>if signed_elements:<EOL><INDENT>if not self.validate_signed_elements(signed_elements, raise_exceptions=True):<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.UNEXPECTED_SIGNED_ELEMENTS<EOL>)<EOL><DEDENT><DEDENT>return signed_elements<EOL>
Verifies the signature nodes:
 - Checks that are Response or Assertion
 - Check that IDs and reference URI are unique and consistent.

:returns: The signed elements tag names
:rtype: list