Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function encrypt (payload, headers) {
return JWE.encrypt(payload, current, { alg, enc, zip: 'DEF', ...headers });
}
static async encrypt(cleartext, key, { enc, alg, cty = typ } = {}) {
const header = {
alg, enc, cty, kid: key.kty !== 'oct' ? key.kid : undefined,
};
return JWE.encrypt(cleartext, key, header);
}