Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jose/jwt/encrypt.ts>EncryptJWT#encrypt

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
method EncryptJWT.prototype.encrypt
import { EncryptJWT } from "https://deno.land/x/jose@v4.15.0/jwt/encrypt.ts";

Encrypts and returns the JWT.

Parameters

key: KeyLike | Uint8Array

Public Key or Secret to encrypt the JWT with. See Algorithm Key Requirements.

optional
options: EncryptOptions

JWE Encryption options.

Returns

Promise<string>