code: def decrypt(self, enctext, key_file=None, id_attr=''):
          
          if not id_attr:
              id_attr = self.id_attr
  
          if not isinstance(key_file, list):
              key_file = [key_file]
  
          key_files = [
              key for key in itertools.chain(key_file, self.enc_key_files) if key
          ]
          for key_file in key_files:
              try:
                  dectext = self.crypto.decrypt(enctext, key_file, id_attr)
              except XmlsecError as e:
                  continue
              else:
                  if dectext:
                      return dectext
  
          errmsg = "No key was able to decrypt the ciphertext. Keys tried: {keys}"
          errmsg = errmsg.format(keys=key_files)
          raise DecryptError(errmsg)
docs: Decrypting an encrypted text by the use of a private key.
  
          :param enctext: The encrypted text as a string
          :return: The decrypted text