How to use the jose.JWE.encrypt function in jose

To help you get started, we’ve selected a few jose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / express-openid-connect / lib / appSession.js View on Github external
function encrypt (payload, headers) {
    return JWE.encrypt(payload, current, { alg, enc, zip: 'DEF', ...headers });
  }
github panva / node-oidc-provider / lib / helpers / jwt.js View on Github external
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);
  }

jose

JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes

MIT
Latest version published 2 months ago

Package Health Score

91 / 100
Full package analysis