@gaonengwww/jose
Version:
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
24 lines (21 loc) • 1.1 kB
TypeScript
import { ProduceJWT, JWTPayload, CompactJWEHeaderParameters, JWEKeyManagementHeaderParameters, CryptoKey, KeyObject, JWK, EncryptOptions } from '../types.d.js';
declare class EncryptJWT implements ProduceJWT {
#private;
constructor(payload?: JWTPayload);
setIssuer(issuer: string): this;
setSubject(subject: string): this;
setAudience(audience: string | string[]): this;
setJti(jwtId: string): this;
setNotBefore(input: number | string | Date): this;
setExpirationTime(input: number | string | Date): this;
setIssuedAt(input?: number | string | Date): this;
setProtectedHeader(protectedHeader: CompactJWEHeaderParameters): this;
setKeyManagementParameters(parameters: JWEKeyManagementHeaderParameters): this;
setContentEncryptionKey(cek: Uint8Array): this;
setInitializationVector(iv: Uint8Array): this;
replicateIssuerAsHeader(): this;
replicateSubjectAsHeader(): this;
replicateAudienceAsHeader(): this;
encrypt(key: CryptoKey | KeyObject | JWK | Uint8Array, options?: EncryptOptions): Promise<string>;
}
export { EncryptJWT };