@gaonengwww/jose
Version:
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
11 lines (8 loc) • 844 B
TypeScript
import { JWTPayload, CryptoKey, KeyObject, JWK, DecryptOptions, JWTClaimVerificationOptions, JWTDecryptResult, GetKeyFunction, CompactJWEHeaderParameters, FlattenedJWE, ResolvedKey } from '../types.d.js';
interface JWTDecryptOptions extends DecryptOptions, JWTClaimVerificationOptions {
}
interface JWTDecryptGetKey extends GetKeyFunction<CompactJWEHeaderParameters, FlattenedJWE> {
}
declare function jwtDecrypt<PayloadType = JWTPayload>(jwt: string | Uint8Array, key: CryptoKey | KeyObject | JWK | Uint8Array, options?: JWTDecryptOptions): Promise<JWTDecryptResult<PayloadType>>;
declare function jwtDecrypt<PayloadType = JWTPayload>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<JWTDecryptResult<PayloadType> & ResolvedKey>;
export { type JWTDecryptGetKey, type JWTDecryptOptions, jwtDecrypt };