def encrypt(self, payload, client_info, cid, val_type="id_token", cty=""):

        try:
            alg = client_info["%s_encrypted_response_alg" % val_type]
            enc = client_info["%s_encrypted_response_enc" % val_type]
        except KeyError as err:  # both must be defined
            logger.warning("undefined parameter: %s" % err)
            raise JWEException("%s undefined" % err)

        logger.debug("alg=%s, enc=%s, val_type=%s" % (alg, enc, val_type))
        keys = self.keyjar.get_encrypt_key(owner=cid)
        logger.debug("Encryption keys for %s: %s" % (cid, keys))
        try:
            _ckeys = self.keyjar[cid]
        except KeyError:
            # Weird, but try to recuperate
            logger.warning(
                "Lost keys for {} trying to recuperate!!".format(cid))
            self.keyjar.issuer_keys[cid] = []
            self.keyjar.add(cid, client_info["jwks_uri"])
            _ckeys = self.keyjar[cid]

        logger.debug("keys for %s: %s" % (
            cid, "[" + ", ".join([str(x) for x in _ckeys])) + "]")

        kwargs = {"alg": alg, "enc": enc}
        if cty:
            kwargs["cty"] = cty

        # use the clients public key for encryption
        _jwe = JWE(payload, **kwargs)
        return _jwe.encrypt(keys, context="public")
Deletes a file by setting its status to deleted
dataset/ETHPy150Open rohe/pyoidc/src/oic/oic/provider.py/Provider.encrypt--crossover with--dataset/ETHPy150Open ExCiteS/geokey/geokey/contributions/models.py/MediaFile.delete