code: def decrypt(self, message):
          
          if not message.is_encrypted:
              warnings.warn("This message is not encrypted", stacklevel=3)
              return message
  
          if self.fingerprint.keyid not in message.encrypters:
              sks = set(self.subkeys)
              mis = set(message.encrypters)
              if sks & mis:
                  skid = list(sks & mis)[0]
                  warnings.warn("Message was encrypted with this key's subkey: {:s}. "
                                "Decrypting with that...".format(skid),
                                stacklevel=2)
                  return self.subkeys[skid].decrypt(message)
  
              raise PGPError("Cannot decrypt the provided message with this key")
  
          pkesk = next(pk for pk in message._sessionkeys if pk.pkalg == self.key_algorithm and pk.encrypter == self.fingerprint.keyid)
          alg, key = pkesk.decrypt_sk(self._key)
  
          # now that we have the symmetric cipher used and the key, we can decrypt the actual message
          decmsg = PGPMessage()
          decmsg.parse(message.message.decrypt(key, alg))
  
          return decmsg
docs: Decrypt a PGPMessage using this key.
  
          :param message: An encrypted :py:obj:`PGPMessage`
          :raises: :py:exc:`~errors.PGPError` if the key is not private, or protected but not unlocked.
          :raises: :py:exc:`~errors.PGPDecryptionError` if decryption fails for any other reason.
          :returns: A new :py:obj:`PGPMessage` with the decrypted contents of ``message``.