@gaonengwww/jose
Version:
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
20 lines (17 loc) • 877 B
TypeScript
import { CryptoKey, KeyObject, JWK, CritOption, JWEHeaderParameters, GeneralJWE } from '../../types.d.js';
interface Recipient {
setUnprotectedHeader(unprotectedHeader: JWEHeaderParameters): Recipient;
addRecipient(...args: Parameters<GeneralEncrypt['addRecipient']>): Recipient;
encrypt(...args: Parameters<GeneralEncrypt['encrypt']>): Promise<GeneralJWE>;
done(): GeneralEncrypt;
}
declare class GeneralEncrypt {
#private;
constructor(plaintext: Uint8Array);
addRecipient(key: CryptoKey | KeyObject | JWK | Uint8Array, options?: CritOption): Recipient;
setProtectedHeader(protectedHeader: JWEHeaderParameters): this;
setSharedUnprotectedHeader(sharedUnprotectedHeader: JWEHeaderParameters): this;
setAdditionalAuthenticatedData(aad: Uint8Array): this;
encrypt(): Promise<GeneralJWE>;
}
export { GeneralEncrypt, type Recipient };