code: def validate_signature(self, signedtext, cert_file, cert_type, node_name, node_id, id_attr):
          
          if not isinstance(signedtext, six.binary_type):
              signedtext = signedtext.encode('utf-8')
  
          _, fil = make_temp(
              signedtext,
              suffix='.xml',
              decode=False,
              delete=self._xmlsec_delete_tmpfiles,
          )
  
          com_list = [
              self.xmlsec,
              '--verify',
              '--enabled-reference-uris', 'empty,same-doc',
              '--pubkey-cert-{type}'.format(type=cert_type), cert_file,
              '--id-attr:{id_attr_name}'.format(id_attr_name=id_attr),
              node_name,
          ]
  
          if node_id:
              com_list.extend(['--node-id', node_id])
  
          try:
              (_stdout, stderr, _output) = self._run_xmlsec(com_list, [fil])
          except XmlsecError as e:
              six.raise_from(SignatureError(com_list), e)
  
          return parse_xmlsec_output(stderr)
docs: Validate signature on XML document.
  
          :param signedtext: The XML document as a string
          :param cert_file: The public key that was used to sign the document
          :param cert_type: The file type of the certificate
          :param node_name: The name of the class that is signed
          :param node_id: The identifier of the node
          :param id_attr: The attribute name for the identifier, normally one of
              'id','Id' or 'ID'
          :return: Boolean True if the signature was correct otherwise False.