unjwt 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,22 +61,22 @@ declare function sanitizeObjectCopy<T extends Record<string, unknown> | undefine
61
61
  * Base64 encoding. Accepts `string` or raw bytes; throws `TypeError` on
62
62
  * `null`/`undefined`. Empty strings and empty `Uint8Array` return `""`.
63
63
  */
64
- declare function base64Encode(data: Uint8Array<ArrayBuffer> | string): string;
64
+ declare function base64Encode(data: Uint8Array | string): string;
65
65
  /**
66
66
  * Base64 URL-safe encoding (no padding). Accepts `string` or raw bytes;
67
67
  * throws `TypeError` on `null`/`undefined`. Empty inputs return `""`.
68
68
  */
69
- declare function base64UrlEncode(data: Uint8Array<ArrayBuffer> | string): string;
70
- declare function base64Decode<T extends DecodeReturnAs>(data: string | Uint8Array<ArrayBuffer>, options: {
69
+ declare function base64UrlEncode(data: Uint8Array | string): string;
70
+ declare function base64Decode<T extends DecodeReturnAs>(data: string | Uint8Array, options: {
71
71
  returnAs: T;
72
72
  }): T extends "string" ? string : Uint8Array<ArrayBuffer>;
73
73
  declare function base64Decode(data: string): string;
74
- declare function base64Decode(data: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
75
- declare function base64UrlDecode<T extends DecodeReturnAs>(data: string | Uint8Array<ArrayBuffer>, options: {
74
+ declare function base64Decode(data: Uint8Array): Uint8Array<ArrayBuffer>;
75
+ declare function base64UrlDecode<T extends DecodeReturnAs>(data: string | Uint8Array, options: {
76
76
  returnAs: T;
77
77
  }): T extends "string" ? string : Uint8Array<ArrayBuffer>;
78
78
  declare function base64UrlDecode(data: string): string;
79
- declare function base64UrlDecode(data: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
79
+ declare function base64UrlDecode(data: Uint8Array): Uint8Array<ArrayBuffer>;
80
80
  /**
81
81
  * Hex encoding. Accepts `string` or raw bytes; throws `TypeError` on
82
82
  * `null`/`undefined`. Empty strings and empty `Uint8Array` return `""`.
@@ -91,4 +91,4 @@ declare function base64UrlDecode(data: Uint8Array<ArrayBuffer>): Uint8Array<Arra
91
91
  type DecodeReturnAs = "string" | "uint8array" | "bytes";
92
92
  declare const textEncoder: TextEncoder;
93
93
  declare const textDecoder: TextDecoder;
94
- export { textDecoder as a, sanitizeObject as c, base64UrlEncode as i, sanitizeObjectCopy as l, base64Encode as n, textEncoder as o, base64UrlDecode as r, safeJsonParse as s, base64Decode as t, secureRandomBytes as u };
94
+ export { base64Decode, base64Encode, base64UrlDecode, base64UrlEncode, safeJsonParse, sanitizeObject, sanitizeObjectCopy, secureRandomBytes, textDecoder, textEncoder };
@@ -82,19 +82,24 @@ const _b64UrlEncOpts = /* @__PURE__ */ Object.freeze({
82
82
  omitPadding: true
83
83
  });
84
84
  const _b64UrlDecOpts = /* @__PURE__ */ Object.freeze({ alphabet: "base64url" });
85
+ function _bytesToBase64Fallback(bytes) {
86
+ let binary = "";
87
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
88
+ return btoa(binary);
89
+ }
85
90
  function base64Encode(data) {
86
91
  if (data == null) throw new TypeError("base64Encode: data must be a string or Uint8Array.");
87
92
  if (_hasBuffer) return _toBuffer(data).toString("base64");
88
93
  const encodedData = data instanceof Uint8Array ? data : textEncoder.encode(data);
89
94
  if (_hasToBase64) return encodedData.toBase64();
90
- return btoa(String.fromCodePoint(...encodedData));
95
+ return _bytesToBase64Fallback(encodedData);
91
96
  }
92
97
  function base64UrlEncode(data) {
93
98
  if (data == null) throw new TypeError("base64UrlEncode: data must be a string or Uint8Array.");
94
99
  if (_hasBuffer) return _toBuffer(data).toString("base64url");
95
100
  const encodedData = data instanceof Uint8Array ? data : textEncoder.encode(data);
96
101
  if (_hasToBase64) return encodedData.toBase64(_b64UrlEncOpts);
97
- return btoa(String.fromCodePoint(...encodedData)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
102
+ return _bytesToBase64Fallback(encodedData).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
98
103
  }
99
104
  function base64Decode(data, options) {
100
105
  if (data == null) throw new TypeError("base64Decode: data must be a string or Uint8Array.");
@@ -104,7 +109,7 @@ function base64Decode(data, options) {
104
109
  if (!str) return decodeToString ? "" : new Uint8Array(0);
105
110
  if (_hasBuffer) {
106
111
  const buf = _Buffer.from(str, "base64");
107
- return decodeToString ? buf.toString("utf8") : new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
112
+ return decodeToString ? buf.toString("utf8") : new Uint8Array(buf);
108
113
  }
109
114
  const decoded = _hasFromBase64 ? Uint8Array.fromBase64(str) : Uint8Array.from(atob(str), (b) => b.codePointAt(0));
110
115
  return decodeToString ? textDecoder.decode(decoded) : decoded;
@@ -117,7 +122,7 @@ function base64UrlDecode(data, options) {
117
122
  if (!str) return decodeToString ? "" : new Uint8Array(0);
118
123
  if (_hasBuffer) {
119
124
  const buf = _Buffer.from(str, "base64url");
120
- return decodeToString ? buf.toString("utf8") : new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
125
+ return decodeToString ? buf.toString("utf8") : new Uint8Array(buf);
121
126
  }
122
127
  let decoded;
123
128
  if (_hasFromBase64) decoded = Uint8Array.fromBase64(str, _b64UrlDecOpts);
@@ -141,4 +146,4 @@ function secureRandomBytes(length) {
141
146
  }
142
147
  return bytes;
143
148
  }
144
- export { base64UrlEncode as a, safeJsonParse as c, base64UrlDecode as i, sanitizeObject as l, base64Decode as n, textDecoder as o, base64Encode as r, textEncoder as s, secureRandomBytes as t, sanitizeObjectCopy as u };
149
+ export { base64Decode, base64Encode, base64UrlDecode, base64UrlEncode, safeJsonParse, sanitizeObject, sanitizeObjectCopy, secureRandomBytes, textDecoder, textEncoder };
@@ -1,4 +1,4 @@
1
- import { c as safeJsonParse, i as base64UrlDecode, o as textDecoder, s as textEncoder } from "./libs/unsecure.mjs";
1
+ import { base64UrlDecode, safeJsonParse, textDecoder, textEncoder } from "./libs/unsecure.mjs";
2
2
  var JWTError = class extends Error {
3
3
  code;
4
4
  cause;
@@ -387,4 +387,4 @@ function isPublicJWK(key) {
387
387
  }
388
388
  return false;
389
389
  }
390
- export { validateCriticalHeadersJWS as C, JWTError as D, inferJWSAllowedAlgorithms as E, isJWTError as O, validateCriticalHeadersJWE as S, inferJWEAllowedAlgorithms as T, decodeMaybeJWTString as _, isCryptoKeyPair as a, getPlaintextBytes as b, isPrivateJWK as c, maybeArray as d, applyTypCtyDefaults as f, computeMaxTokenAgeSeconds as g, computeJwtTimeClaims as h, isCryptoKey as i, isPublicJWK as l, computeExpiresInSeconds as m, concatUint8Arrays as n, isJWK as o, computeDurationInSeconds as p, isAsymmetricJWK as r, isJWKSet as s, assertCryptoKey as t, isSymmetricJWK as u, decodePayloadFromB64UrlSegment as v, validateJwtClaims as w, isJWTContent as x, decodePayloadFromBytes as y };
390
+ export { JWTError, applyTypCtyDefaults, assertCryptoKey, computeDurationInSeconds, computeExpiresInSeconds, computeJwtTimeClaims, computeMaxTokenAgeSeconds, concatUint8Arrays, decodeMaybeJWTString, decodePayloadFromB64UrlSegment, decodePayloadFromBytes, getPlaintextBytes, inferJWEAllowedAlgorithms, inferJWSAllowedAlgorithms, isAsymmetricJWK, isCryptoKey, isCryptoKeyPair, isJWK, isJWKSet, isJWTContent, isJWTError, isPrivateJWK, isPublicJWK, isSymmetricJWK, maybeArray, validateCriticalHeadersJWE, validateCriticalHeadersJWS, validateJwtClaims };
@@ -0,0 +1,244 @@
1
+ import { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, Duration, ExpiresIn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JOSEPayload, JWEAsymmetricPrivateJWK, JWEAsymmetricPublicJWK, JWEDecryptJWK, JWEDecryptOptions, JWEDecryptResult, JWEEncryptJWK, JWEEncryptOptions, JWEFlattenedSerialization, JWEGeneralRecipient, JWEGeneralSerialization, JWEHeaderParameters, JWEKeyManagementHeaderParameters, JWEMultiDecryptOptions, JWEMultiDecryptResult, JWEMultiEncryptOptions, JWEMultiRecipient, JWEProtectedHeader, JWK, JWKAlgorithm, JWKCacheAdapter, JWKLookupFunction, JWKLookupFunctionHeader, JWKPEMAlgorithm, JWKParameters, JWKSet, JWK_AES_CBC_HMAC, JWK_AES_GCM, JWK_AES_GCM_KW, JWK_AES_KW, JWK_Asymmetric, JWK_Asymmetric_Algorithm, JWK_EC, JWK_ECDH_ES, JWK_ECDSA, JWK_EC_Private, JWK_EC_Public, JWK_HMAC, JWK_OKP, JWK_OKP_Private, JWK_OKP_Public, JWK_OKP_SIGN, JWK_PBES2, JWK_Pair, JWK_Private, JWK_Public, JWK_RSA, JWK_RSA_ENC, JWK_RSA_PSS, JWK_RSA_Private, JWK_RSA_Public, JWK_RSA_SIGN, JWK_Symmetric, JWK_Symmetric_Algorithm, JWK_oct, JWSAlgorithm, JWSAsymmetricPrivateJWK, JWSAsymmetricPublicJWK, JWSFlattenedSerialization, JWSGeneralSerialization, JWSGeneralSignature, JWSHeaderParameters, JWSMultiSignOptions, JWSMultiSigner, JWSMultiVerifyAllOptions, JWSMultiVerifyOptions, JWSMultiVerifyOutcome, JWSMultiVerifyResult, JWSProtectedHeader, JWSSignJWK, JWSSignOptions, JWSVerifyJWK, JWSVerifyOptions, JWSVerifyResult, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, MaxTokenAge, NotBeforeIn, StrictOmit, UnwrapKeyOptions, UnwrappingKeyFor, WrapKeyOptions, WrapKeyResult, WrappingKeyFor } from "../../_chunks/index.mjs";
2
+ import { deriveJWKFromPassword, exportPEM, generateJWK, importPEM } from "../../core/jwk.mjs";
3
+ import { Elysia } from "elysia";
4
+ interface CookieAttributes {
5
+ domain?: string;
6
+ expires?: Date;
7
+ httpOnly?: boolean;
8
+ maxAge?: number;
9
+ path?: string;
10
+ priority?: "low" | "medium" | "high";
11
+ sameSite?: boolean | "lax" | "strict" | "none";
12
+ secure?: boolean;
13
+ partitioned?: boolean;
14
+ }
15
+ interface ChunkableCookie {
16
+ value: unknown;
17
+ set(config: CookieAttributes & {
18
+ value: string;
19
+ }): unknown;
20
+ }
21
+ type ChunkableCookieJar = Record<string, ChunkableCookie>;
22
+ type WriteChunkedCookieOptions = CookieAttributes & {
23
+ chunkMaxLength?: number;
24
+ };
25
+ interface SessionContext {
26
+ cookie: ChunkableCookieJar;
27
+ request: {
28
+ headers: {
29
+ get(name: string): string | null;
30
+ };
31
+ };
32
+ }
33
+ interface SessionClaims extends Required<Pick<JWTClaims, "jti" | "iat">>, StrictOmit<JWTClaims, "jti" | "iat"> {}
34
+ type SessionData<T extends Record<string, any> = SessionClaims> = StrictOmit<T, "jti" | "iat" | "exp">;
35
+ type SessionUpdate<T extends Record<string, any> = SessionClaims> = Partial<SessionData<T>> | ((oldData: SessionData<T>) => Partial<SessionData<T>> | undefined);
36
+ interface SessionManager<T extends Record<string, any> = SessionClaims, ConfigMaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
37
+ readonly id: string | undefined;
38
+ readonly createdAt: number;
39
+ readonly expiresAt: ConfigMaxAge extends ExpiresIn ? number : "exp" extends keyof T ? T["exp"] : number | undefined;
40
+ readonly data: SessionData<T>;
41
+ readonly token: string | undefined;
42
+ update: (update?: SessionUpdate<T>) => Promise<SessionManager<T, ConfigMaxAge>>;
43
+ clear: () => Promise<SessionManager<T, ConfigMaxAge>>;
44
+ }
45
+ /**
46
+ * Explicit return type for the `jwsSession` / `jweSession` plugin factories.
47
+ *
48
+ * Modelling Elysia's generics by hand is required by `isolatedDeclarations`
49
+ * (the factories return an inferred `new Elysia().resolve().macro()` type that
50
+ * cannot otherwise be emitted). `Resolved` is the scoped `Ephemeral.resolve`
51
+ * augmentation — typically `{ [P in ContextKey]: SessionManager }` — so consumers
52
+ * read a typed `ctx[contextKey]`. `GuardName` is the guard macro key (derived
53
+ * from the context key, e.g. `requireSession`), so multiple session plugins on
54
+ * one app each expose a distinct guard rather than colliding. `macroFn` is left
55
+ * `{}`: consumers only need `Metadata.macro` for the `{ [GuardName]: true }`
56
+ * route option.
57
+ */
58
+ type SessionPlugin<Resolved extends Record<string, unknown>, GuardName extends string = "requireSession"> = Elysia<"", {
59
+ decorator: {};
60
+ store: {};
61
+ derive: {};
62
+ resolve: {};
63
+ }, {
64
+ typebox: {};
65
+ error: {};
66
+ }, {
67
+ schema: {};
68
+ standaloneSchema: {};
69
+ macro: { [M in GuardName]?: boolean };
70
+ macroFn: {};
71
+ parser: {};
72
+ response: {};
73
+ }, {}, {
74
+ derive: {};
75
+ resolve: Resolved;
76
+ schema: {};
77
+ standaloneSchema: {};
78
+ response: {};
79
+ }, {
80
+ derive: {};
81
+ resolve: {};
82
+ schema: {};
83
+ standaloneSchema: {};
84
+ response: {};
85
+ }>;
86
+ interface SessionJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
87
+ id: string | undefined;
88
+ createdAt: number;
89
+ expiresAt: MaxAge extends ExpiresIn ? number : T["exp"];
90
+ data: SessionData<T>;
91
+ token: string | undefined;
92
+ }
93
+ interface SessionHooksJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext> {
94
+ onRead?: (args: {
95
+ session: SessionJWS<T, MaxAge> & {
96
+ id: string;
97
+ token: string;
98
+ };
99
+ context: TContext;
100
+ config: SessionConfigJWS<T, MaxAge, TContext>;
101
+ }) => void | Promise<void>;
102
+ onUpdate?: (args: {
103
+ session: SessionJWS<T, MaxAge> & {
104
+ id: string;
105
+ token: string;
106
+ };
107
+ oldSession: SessionJWS<T, MaxAge>;
108
+ context: TContext;
109
+ config: SessionConfigJWS<T, MaxAge, TContext>;
110
+ }) => void | Promise<void>;
111
+ onClear?: (args: {
112
+ oldSession: SessionJWS<T, MaxAge> | undefined;
113
+ context: TContext;
114
+ config: SessionConfigJWS<T, MaxAge, TContext>;
115
+ }) => void | Promise<void>;
116
+ onExpire?: (args: {
117
+ session: {
118
+ id: string | undefined;
119
+ createdAt: number | undefined;
120
+ expiresAt: number | undefined;
121
+ token: string;
122
+ };
123
+ context: TContext;
124
+ error: Error;
125
+ config: SessionConfigJWS<T, MaxAge, TContext>;
126
+ }) => void | Promise<void>;
127
+ onError?: (args: {
128
+ session: SessionJWS<T, MaxAge>;
129
+ context: TContext;
130
+ error: any;
131
+ config: SessionConfigJWS<T, MaxAge, TContext>;
132
+ }) => void | Promise<void>;
133
+ onVerifyKeyLookup?: (args: {
134
+ header: JWKLookupFunctionHeader;
135
+ context: TContext;
136
+ config: SessionConfigJWS<T, MaxAge, TContext>;
137
+ }) => JWKSet | JWSVerifyJWK | Promise<JWKSet | JWSVerifyJWK>;
138
+ }
139
+ interface SessionConfigJWS<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext> {
140
+ key: JWK_oct<JWK_HMAC> | {
141
+ privateKey: JWSAsymmetricPrivateJWK;
142
+ publicKey: JWSAsymmetricPublicJWK | JWSAsymmetricPublicJWK[] | JWKSet;
143
+ };
144
+ maxAge?: MaxAge;
145
+ name?: string;
146
+ /** Context property the session is exposed under. Default `"session"`. */
147
+ contextKey?: string;
148
+ cookie?: false | (CookieAttributes & {
149
+ chunkMaxLength?: number;
150
+ });
151
+ sessionHeader?: false | string;
152
+ generateId?: () => string;
153
+ jws?: {
154
+ signOptions?: Omit<JWSSignOptions, "expiresIn">;
155
+ verifyOptions?: JWTClaimValidationOptions;
156
+ };
157
+ hooks?: SessionHooksJWS<T, MaxAge, TContext>;
158
+ }
159
+ declare function createJWSSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext>(context: TContext, config: SessionConfigJWS<T, MaxAge, TContext>): Promise<SessionManager<T, MaxAge>>;
160
+ declare function jwsSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, K extends string = "session">(config: SessionConfigJWS<T, MaxAge> & (K extends "session" ? {
161
+ contextKey?: K;
162
+ } : {
163
+ contextKey: K;
164
+ })): SessionPlugin<{ [P in K]: SessionManager<T, MaxAge> }, `require${Capitalize<K>}`>;
165
+ interface SessionJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined> {
166
+ id: string | undefined;
167
+ createdAt: number;
168
+ expiresAt: MaxAge extends ExpiresIn ? number : T["exp"];
169
+ data: SessionData<T>;
170
+ token: string | undefined;
171
+ }
172
+ interface SessionHooksJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext> {
173
+ onRead?: (args: {
174
+ session: SessionJWE<T, MaxAge> & {
175
+ id: string;
176
+ token: string;
177
+ };
178
+ context: TContext;
179
+ config: SessionConfigJWE<T, MaxAge, TContext>;
180
+ }) => void | Promise<void>;
181
+ onUpdate?: (args: {
182
+ session: SessionJWE<T, MaxAge> & {
183
+ id: string;
184
+ token: string;
185
+ };
186
+ oldSession: SessionJWE<T, MaxAge>;
187
+ context: TContext;
188
+ config: SessionConfigJWE<T, MaxAge, TContext>;
189
+ }) => void | Promise<void>;
190
+ onClear?: (args: {
191
+ oldSession: SessionJWE<T, MaxAge> | undefined;
192
+ context: TContext;
193
+ config: SessionConfigJWE<T, MaxAge, TContext>;
194
+ }) => void | Promise<void>;
195
+ onExpire?: (args: {
196
+ session: {
197
+ id: string | undefined;
198
+ createdAt: number | undefined;
199
+ expiresAt: number | undefined;
200
+ token: string;
201
+ };
202
+ context: TContext;
203
+ error: Error;
204
+ config: SessionConfigJWE<T, MaxAge, TContext>;
205
+ }) => void | Promise<void>;
206
+ onError?: (args: {
207
+ session: SessionJWE<T, MaxAge>;
208
+ context: TContext;
209
+ error: any;
210
+ config: SessionConfigJWE<T, MaxAge, TContext>;
211
+ }) => void | Promise<void>;
212
+ onUnsealKeyLookup?: (args: {
213
+ header: JWEHeaderParameters;
214
+ context: TContext;
215
+ config: SessionConfigJWE<T, MaxAge, TContext>;
216
+ }) => JWEDecryptJWK | Promise<JWEDecryptJWK>;
217
+ }
218
+ interface SessionConfigJWE<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext> {
219
+ key: string | JWEEncryptJWK | {
220
+ privateKey: JWEAsymmetricPrivateJWK;
221
+ publicKey?: JWEAsymmetricPublicJWK;
222
+ };
223
+ maxAge?: MaxAge;
224
+ name?: string;
225
+ /** Context property the session is exposed under. Default `"session"`. */
226
+ contextKey?: string;
227
+ cookie?: false | (CookieAttributes & {
228
+ chunkMaxLength?: number;
229
+ });
230
+ sessionHeader?: false | string;
231
+ generateId?: () => string;
232
+ jwe?: {
233
+ encryptOptions?: Omit<JWEEncryptOptions, "expiresIn">;
234
+ decryptOptions?: JWTClaimValidationOptions;
235
+ };
236
+ hooks?: SessionHooksJWE<T, MaxAge, TContext>;
237
+ }
238
+ declare function createJWESession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, TContext extends SessionContext = SessionContext>(context: TContext, config: SessionConfigJWE<T, MaxAge, TContext>): Promise<SessionManager<T, MaxAge>>;
239
+ declare function jweSession<T extends Record<string, any> = SessionClaims, MaxAge extends ExpiresIn | undefined = ExpiresIn | undefined, K extends string = "session">(config: SessionConfigJWE<T, MaxAge> & (K extends "session" ? {
240
+ contextKey?: K;
241
+ } : {
242
+ contextKey: K;
243
+ })): SessionPlugin<{ [P in K]: SessionManager<T, MaxAge> }, `require${Capitalize<K>}`>;
244
+ export { type ChunkableCookie, type ChunkableCookieJar, type CompositeKey, type ContentEncryptionAlgorithm, type CookieAttributes, type DeriveKeyOptions, type DeriveKeyReturn, type Duration, type ExpiresIn, type GenerateJWKOptions, type GenerateJWKReturn, type GenerateKeyAlgorithm, type GenerateKeyOptions, type GenerateKeyReturn, type JOSEPayload, type JWEAsymmetricPrivateJWK, type JWEAsymmetricPublicJWK, type JWEDecryptJWK, type JWEDecryptOptions, type JWEDecryptResult, type JWEEncryptJWK, type JWEEncryptOptions, type JWEFlattenedSerialization, type JWEGeneralRecipient, type JWEGeneralSerialization, type JWEHeaderParameters, type JWEKeyManagementHeaderParameters, type JWEMultiDecryptOptions, type JWEMultiDecryptResult, type JWEMultiEncryptOptions, type JWEMultiRecipient, type JWEProtectedHeader, type JWK, type JWKAlgorithm, type JWKCacheAdapter, type JWKLookupFunction, type JWKLookupFunctionHeader, type JWKPEMAlgorithm, type JWKParameters, type JWKSet, type JWK_AES_CBC_HMAC, type JWK_AES_GCM, type JWK_AES_GCM_KW, type JWK_AES_KW, type JWK_Asymmetric, type JWK_Asymmetric_Algorithm, type JWK_EC, type JWK_ECDH_ES, type JWK_ECDSA, type JWK_EC_Private, type JWK_EC_Public, type JWK_HMAC, type JWK_OKP, type JWK_OKP_Private, type JWK_OKP_Public, type JWK_OKP_SIGN, type JWK_PBES2, type JWK_Pair, type JWK_Private, type JWK_Public, type JWK_RSA, type JWK_RSA_ENC, type JWK_RSA_PSS, type JWK_RSA_Private, type JWK_RSA_Public, type JWK_RSA_SIGN, type JWK_Symmetric, type JWK_Symmetric_Algorithm, type JWK_oct, type JWSAlgorithm, type JWSAsymmetricPrivateJWK, type JWSAsymmetricPublicJWK, type JWSFlattenedSerialization, type JWSGeneralSerialization, type JWSGeneralSignature, type JWSHeaderParameters, type JWSMultiSignOptions, type JWSMultiSigner, type JWSMultiVerifyAllOptions, type JWSMultiVerifyOptions, type JWSMultiVerifyOutcome, type JWSMultiVerifyResult, type JWSProtectedHeader, type JWSSignJWK, type JWSSignOptions, type JWSVerifyJWK, type JWSVerifyOptions, type JWSVerifyResult, type JWT, type JWTClaimValidationOptions, type JWTClaims, type JoseHeaderParameters, type KeyManagementAlgorithm, type MaxTokenAge, type NotBeforeIn, type SessionClaims, type SessionConfigJWE, type SessionConfigJWS, type SessionContext, type SessionData, type SessionHooksJWE, type SessionHooksJWS, type SessionJWE, type SessionJWS, type SessionManager, type SessionPlugin, type SessionUpdate, type UnwrapKeyOptions, type UnwrappingKeyFor, type WrapKeyOptions, type WrapKeyResult, type WrappingKeyFor, type WriteChunkedCookieOptions, createJWESession, createJWSSession, deriveJWKFromPassword, exportPEM, generateJWK, importPEM, jweSession, jwsSession };