unjwt 0.5.20 → 0.5.22
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.
- package/README.md +56 -0
- package/dist/h3.d.mts +209 -0
- package/dist/h3.mjs +510 -0
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +4 -4
- package/dist/jwe.d.mts +3 -2
- package/dist/jwe.mjs +3 -3
- package/dist/jwk.d.mts +2 -2
- package/dist/jwk.mjs +2 -2
- package/dist/jws.d.mts +3 -2
- package/dist/jws.mjs +3 -3
- package/dist/shared/unjwt.9mL1vSFP.d.mts +154 -0
- package/dist/shared/{unjwt.ChCsF4q6.d.mts → unjwt.BjP_dGnX.d.mts} +6 -2
- package/dist/shared/{unjwt.BuQdWrN5.d.mts → unjwt.BrNGm4On.d.mts} +1 -1
- package/dist/shared/unjwt.BsLgL0DQ.d.mts +64 -0
- package/dist/shared/unjwt.C5jNR_1K.d.mts +166 -0
- package/dist/shared/{unjwt.CaZJRuRa.mjs → unjwt.CXl9FD-V.mjs} +2 -2
- package/dist/shared/{unjwt.Dy68jE0N.d.mts → unjwt.CtHrClHc.d.mts} +5 -1
- package/dist/shared/{unjwt.K_6rgVTy.mjs → unjwt.DCiTNyCM.mjs} +1 -1
- package/dist/shared/{unjwt.Dc_YDjvO.mjs → unjwt.DmRAjMp8.mjs} +3 -5
- package/dist/shared/unjwt.VUfJDcCJ.d.mts +161 -0
- package/dist/shared/{unjwt.D7ya3PwS.mjs → unjwt.Vg02PZWw.mjs} +10 -21
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +19 -1
- package/dist/shared/unjwt.BFtNZVqt.d.mts +0 -252
- package/dist/shared/unjwt.DANsaNYC.d.mts +0 -166
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { X as JWTClaims, v as JWK, K as KeyManagementAlgorithm, f as ContentEncryptionAlgorithm, r as JWK_Symmetric, u as JWK_Private, C as CompositeKey, D as DeriveKeyOptions, e as DeriveKeyReturn, c as GenerateJWKOptions, d as GenerateJWKReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, S as JWKAlgorithm, T as JWKPEMAlgorithm, J as JWKParameters, w as JWKSet, I as JWK_AES_CBC_HMAC, L as JWK_AES_GCM, H as JWK_AES_GCM_KW, F as JWK_AES_KW, s as JWK_Asymmetric, R as JWK_Asymmetric_Algorithm, j as JWK_EC, O as JWK_ECDH_ES, A as JWK_ECDSA, i as JWK_EC_Private, h as JWK_EC_Public, x as JWK_HMAC, p as JWK_OKP, o as JWK_OKP_Private, n as JWK_OKP_Public, P as JWK_OKP_SIGN, N as JWK_PBES2, t as JWK_Public, m as JWK_RSA, B as JWK_RSA_ENC, z as JWK_RSA_PSS, l as JWK_RSA_Private, k as JWK_RSA_Public, y as JWK_RSA_SIGN, Q as JWK_Symmetric_Algorithm, q as JWK_oct, Y as JWT, Z as JWTClaimValidationOptions, V as JoseHeaderParameters, U as UnwrapKeyOptions, W as WrapKeyOptions, g as WrapKeyResult } from './unjwt.CtHrClHc.mjs';
|
|
2
|
+
import { b as JWEEncryptOptions, c as JWEKeyLookupFunction, d as JWEDecryptOptions, e as JWEDecryptResult, J as JWEHeaderParameters, a as JWEKeyManagementHeaderParameters } from './unjwt.9mL1vSFP.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Encrypts a payload to produce a JWE Compact Serialization string.
|
|
6
|
+
*
|
|
7
|
+
* @param payload The payload to encrypt. Can be a string, Uint8Array, or a JSON-serializable object.
|
|
8
|
+
* @param key The key encryption key (KEK). Can be a CryptoKey, JWK, or for PBES2, a password string/Uint8Array.
|
|
9
|
+
* @param options JWE encryption options, including `alg` (key management algorithm) and `enc` (content encryption algorithm).
|
|
10
|
+
* @returns A Promise resolving to the JWE Compact Serialization string.
|
|
11
|
+
*/
|
|
12
|
+
declare function encrypt(payload: JWTClaims, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
13
|
+
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
14
|
+
declare function encrypt(payload: JWTClaims, key: CryptoKey, options: JWEEncryptOptions & {
|
|
15
|
+
alg: KeyManagementAlgorithm;
|
|
16
|
+
enc: ContentEncryptionAlgorithm;
|
|
17
|
+
}): Promise<string>;
|
|
18
|
+
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey, options: JWEEncryptOptions & {
|
|
19
|
+
alg: KeyManagementAlgorithm;
|
|
20
|
+
enc: ContentEncryptionAlgorithm;
|
|
21
|
+
}): Promise<string>;
|
|
22
|
+
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey | JWK | string | Uint8Array<ArrayBuffer>, options: JWEEncryptOptions & {
|
|
23
|
+
alg: KeyManagementAlgorithm;
|
|
24
|
+
enc: ContentEncryptionAlgorithm;
|
|
25
|
+
}): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Decrypts a JWE Compact Serialization string.
|
|
28
|
+
*
|
|
29
|
+
* @param jwe The JWE Compact Serialization string.
|
|
30
|
+
* @param key The key decryption key (KEK) or a function to look up the key.
|
|
31
|
+
* @param options JWE decryption options.
|
|
32
|
+
* @returns A Promise resolving to an object containing the decrypted plaintext, protected header, CEK, and AAD.
|
|
33
|
+
* @throws If JWE is invalid, decryption fails, or options are not met.
|
|
34
|
+
*/
|
|
35
|
+
declare function decrypt<T extends JWTClaims | Uint8Array<ArrayBuffer> | string>(jwe: string, key: CryptoKey | JWK_Symmetric | JWK_Private | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options?: JWEDecryptOptions): Promise<JWEDecryptResult<T>>;
|
|
36
|
+
declare function decrypt(jwe: string, key: CryptoKey | JWK_Symmetric | JWK_Private | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options: JWEDecryptOptions & {
|
|
37
|
+
forceUint8Array: true;
|
|
38
|
+
}): Promise<JWEDecryptResult<Uint8Array<ArrayBuffer>>>;
|
|
39
|
+
|
|
40
|
+
declare const jwe_CompositeKey: typeof CompositeKey;
|
|
41
|
+
declare const jwe_ContentEncryptionAlgorithm: typeof ContentEncryptionAlgorithm;
|
|
42
|
+
declare const jwe_DeriveKeyOptions: typeof DeriveKeyOptions;
|
|
43
|
+
declare const jwe_DeriveKeyReturn: typeof DeriveKeyReturn;
|
|
44
|
+
declare const jwe_GenerateJWKOptions: typeof GenerateJWKOptions;
|
|
45
|
+
declare const jwe_GenerateJWKReturn: typeof GenerateJWKReturn;
|
|
46
|
+
declare const jwe_GenerateKeyAlgorithm: typeof GenerateKeyAlgorithm;
|
|
47
|
+
declare const jwe_GenerateKeyOptions: typeof GenerateKeyOptions;
|
|
48
|
+
declare const jwe_GenerateKeyReturn: typeof GenerateKeyReturn;
|
|
49
|
+
declare const jwe_JWEDecryptOptions: typeof JWEDecryptOptions;
|
|
50
|
+
declare const jwe_JWEDecryptResult: typeof JWEDecryptResult;
|
|
51
|
+
declare const jwe_JWEEncryptOptions: typeof JWEEncryptOptions;
|
|
52
|
+
declare const jwe_JWEHeaderParameters: typeof JWEHeaderParameters;
|
|
53
|
+
declare const jwe_JWEKeyLookupFunction: typeof JWEKeyLookupFunction;
|
|
54
|
+
declare const jwe_JWEKeyManagementHeaderParameters: typeof JWEKeyManagementHeaderParameters;
|
|
55
|
+
declare const jwe_JWK: typeof JWK;
|
|
56
|
+
declare const jwe_JWKAlgorithm: typeof JWKAlgorithm;
|
|
57
|
+
declare const jwe_JWKPEMAlgorithm: typeof JWKPEMAlgorithm;
|
|
58
|
+
declare const jwe_JWKParameters: typeof JWKParameters;
|
|
59
|
+
declare const jwe_JWKSet: typeof JWKSet;
|
|
60
|
+
declare const jwe_JWK_AES_CBC_HMAC: typeof JWK_AES_CBC_HMAC;
|
|
61
|
+
declare const jwe_JWK_AES_GCM: typeof JWK_AES_GCM;
|
|
62
|
+
declare const jwe_JWK_AES_GCM_KW: typeof JWK_AES_GCM_KW;
|
|
63
|
+
declare const jwe_JWK_AES_KW: typeof JWK_AES_KW;
|
|
64
|
+
declare const jwe_JWK_Asymmetric: typeof JWK_Asymmetric;
|
|
65
|
+
declare const jwe_JWK_Asymmetric_Algorithm: typeof JWK_Asymmetric_Algorithm;
|
|
66
|
+
declare const jwe_JWK_EC: typeof JWK_EC;
|
|
67
|
+
declare const jwe_JWK_ECDH_ES: typeof JWK_ECDH_ES;
|
|
68
|
+
declare const jwe_JWK_ECDSA: typeof JWK_ECDSA;
|
|
69
|
+
declare const jwe_JWK_EC_Private: typeof JWK_EC_Private;
|
|
70
|
+
declare const jwe_JWK_EC_Public: typeof JWK_EC_Public;
|
|
71
|
+
declare const jwe_JWK_HMAC: typeof JWK_HMAC;
|
|
72
|
+
declare const jwe_JWK_OKP: typeof JWK_OKP;
|
|
73
|
+
declare const jwe_JWK_OKP_Private: typeof JWK_OKP_Private;
|
|
74
|
+
declare const jwe_JWK_OKP_Public: typeof JWK_OKP_Public;
|
|
75
|
+
declare const jwe_JWK_OKP_SIGN: typeof JWK_OKP_SIGN;
|
|
76
|
+
declare const jwe_JWK_PBES2: typeof JWK_PBES2;
|
|
77
|
+
declare const jwe_JWK_Private: typeof JWK_Private;
|
|
78
|
+
declare const jwe_JWK_Public: typeof JWK_Public;
|
|
79
|
+
declare const jwe_JWK_RSA: typeof JWK_RSA;
|
|
80
|
+
declare const jwe_JWK_RSA_ENC: typeof JWK_RSA_ENC;
|
|
81
|
+
declare const jwe_JWK_RSA_PSS: typeof JWK_RSA_PSS;
|
|
82
|
+
declare const jwe_JWK_RSA_Private: typeof JWK_RSA_Private;
|
|
83
|
+
declare const jwe_JWK_RSA_Public: typeof JWK_RSA_Public;
|
|
84
|
+
declare const jwe_JWK_RSA_SIGN: typeof JWK_RSA_SIGN;
|
|
85
|
+
declare const jwe_JWK_Symmetric: typeof JWK_Symmetric;
|
|
86
|
+
declare const jwe_JWK_Symmetric_Algorithm: typeof JWK_Symmetric_Algorithm;
|
|
87
|
+
declare const jwe_JWK_oct: typeof JWK_oct;
|
|
88
|
+
declare const jwe_JWT: typeof JWT;
|
|
89
|
+
declare const jwe_JWTClaimValidationOptions: typeof JWTClaimValidationOptions;
|
|
90
|
+
declare const jwe_JWTClaims: typeof JWTClaims;
|
|
91
|
+
declare const jwe_JoseHeaderParameters: typeof JoseHeaderParameters;
|
|
92
|
+
declare const jwe_KeyManagementAlgorithm: typeof KeyManagementAlgorithm;
|
|
93
|
+
declare const jwe_UnwrapKeyOptions: typeof UnwrapKeyOptions;
|
|
94
|
+
declare const jwe_WrapKeyOptions: typeof WrapKeyOptions;
|
|
95
|
+
declare const jwe_WrapKeyResult: typeof WrapKeyResult;
|
|
96
|
+
declare const jwe_decrypt: typeof decrypt;
|
|
97
|
+
declare const jwe_encrypt: typeof encrypt;
|
|
98
|
+
declare namespace jwe {
|
|
99
|
+
export {
|
|
100
|
+
jwe_CompositeKey as CompositeKey,
|
|
101
|
+
jwe_ContentEncryptionAlgorithm as ContentEncryptionAlgorithm,
|
|
102
|
+
jwe_DeriveKeyOptions as DeriveKeyOptions,
|
|
103
|
+
jwe_DeriveKeyReturn as DeriveKeyReturn,
|
|
104
|
+
jwe_GenerateJWKOptions as GenerateJWKOptions,
|
|
105
|
+
jwe_GenerateJWKReturn as GenerateJWKReturn,
|
|
106
|
+
jwe_GenerateKeyAlgorithm as GenerateKeyAlgorithm,
|
|
107
|
+
jwe_GenerateKeyOptions as GenerateKeyOptions,
|
|
108
|
+
jwe_GenerateKeyReturn as GenerateKeyReturn,
|
|
109
|
+
jwe_JWEDecryptOptions as JWEDecryptOptions,
|
|
110
|
+
jwe_JWEDecryptResult as JWEDecryptResult,
|
|
111
|
+
jwe_JWEEncryptOptions as JWEEncryptOptions,
|
|
112
|
+
jwe_JWEHeaderParameters as JWEHeaderParameters,
|
|
113
|
+
jwe_JWEKeyLookupFunction as JWEKeyLookupFunction,
|
|
114
|
+
jwe_JWEKeyManagementHeaderParameters as JWEKeyManagementHeaderParameters,
|
|
115
|
+
jwe_JWK as JWK,
|
|
116
|
+
jwe_JWKAlgorithm as JWKAlgorithm,
|
|
117
|
+
jwe_JWKPEMAlgorithm as JWKPEMAlgorithm,
|
|
118
|
+
jwe_JWKParameters as JWKParameters,
|
|
119
|
+
jwe_JWKSet as JWKSet,
|
|
120
|
+
jwe_JWK_AES_CBC_HMAC as JWK_AES_CBC_HMAC,
|
|
121
|
+
jwe_JWK_AES_GCM as JWK_AES_GCM,
|
|
122
|
+
jwe_JWK_AES_GCM_KW as JWK_AES_GCM_KW,
|
|
123
|
+
jwe_JWK_AES_KW as JWK_AES_KW,
|
|
124
|
+
jwe_JWK_Asymmetric as JWK_Asymmetric,
|
|
125
|
+
jwe_JWK_Asymmetric_Algorithm as JWK_Asymmetric_Algorithm,
|
|
126
|
+
jwe_JWK_EC as JWK_EC,
|
|
127
|
+
jwe_JWK_ECDH_ES as JWK_ECDH_ES,
|
|
128
|
+
jwe_JWK_ECDSA as JWK_ECDSA,
|
|
129
|
+
jwe_JWK_EC_Private as JWK_EC_Private,
|
|
130
|
+
jwe_JWK_EC_Public as JWK_EC_Public,
|
|
131
|
+
jwe_JWK_HMAC as JWK_HMAC,
|
|
132
|
+
jwe_JWK_OKP as JWK_OKP,
|
|
133
|
+
jwe_JWK_OKP_Private as JWK_OKP_Private,
|
|
134
|
+
jwe_JWK_OKP_Public as JWK_OKP_Public,
|
|
135
|
+
jwe_JWK_OKP_SIGN as JWK_OKP_SIGN,
|
|
136
|
+
jwe_JWK_PBES2 as JWK_PBES2,
|
|
137
|
+
jwe_JWK_Private as JWK_Private,
|
|
138
|
+
jwe_JWK_Public as JWK_Public,
|
|
139
|
+
jwe_JWK_RSA as JWK_RSA,
|
|
140
|
+
jwe_JWK_RSA_ENC as JWK_RSA_ENC,
|
|
141
|
+
jwe_JWK_RSA_PSS as JWK_RSA_PSS,
|
|
142
|
+
jwe_JWK_RSA_Private as JWK_RSA_Private,
|
|
143
|
+
jwe_JWK_RSA_Public as JWK_RSA_Public,
|
|
144
|
+
jwe_JWK_RSA_SIGN as JWK_RSA_SIGN,
|
|
145
|
+
jwe_JWK_Symmetric as JWK_Symmetric,
|
|
146
|
+
jwe_JWK_Symmetric_Algorithm as JWK_Symmetric_Algorithm,
|
|
147
|
+
jwe_JWK_oct as JWK_oct,
|
|
148
|
+
jwe_JWT as JWT,
|
|
149
|
+
jwe_JWTClaimValidationOptions as JWTClaimValidationOptions,
|
|
150
|
+
jwe_JWTClaims as JWTClaims,
|
|
151
|
+
jwe_JoseHeaderParameters as JoseHeaderParameters,
|
|
152
|
+
jwe_KeyManagementAlgorithm as KeyManagementAlgorithm,
|
|
153
|
+
jwe_UnwrapKeyOptions as UnwrapKeyOptions,
|
|
154
|
+
jwe_WrapKeyOptions as WrapKeyOptions,
|
|
155
|
+
jwe_WrapKeyResult as WrapKeyResult,
|
|
156
|
+
jwe_decrypt as decrypt,
|
|
157
|
+
jwe_encrypt as encrypt,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { decrypt as d, encrypt as e, jwe as j };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as isCryptoKey,
|
|
1
|
+
import { k as isCryptoKey, w as concatUint8Arrays, d as base64UrlEncode, x as base64Decode, y as base64Encode, t as textEncoder, s as sanitizeObject, z as assertCryptoKey, a as isJWK, e as base64UrlDecode, u as isAsymmetricJWK, r as randomBytes, m as isJWKSet } from './unjwt.DCiTNyCM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This is a fork of Jose library's utility functions.
|
|
@@ -1459,7 +1459,6 @@ async function generateKey(alg, options = {}) {
|
|
|
1459
1459
|
if (key instanceof CryptoKey) {
|
|
1460
1460
|
return exportKey(key, {
|
|
1461
1461
|
...additionalKeyParams,
|
|
1462
|
-
key_ops: keyUsages,
|
|
1463
1462
|
alg
|
|
1464
1463
|
});
|
|
1465
1464
|
} else {
|
|
@@ -1467,7 +1466,6 @@ async function generateKey(alg, options = {}) {
|
|
|
1467
1466
|
exportKey(key.publicKey, { ...additionalKeyParams, alg }),
|
|
1468
1467
|
exportKey(key.privateKey, {
|
|
1469
1468
|
...additionalKeyParams,
|
|
1470
|
-
key_ops: keyUsages,
|
|
1471
1469
|
alg
|
|
1472
1470
|
})
|
|
1473
1471
|
]);
|
|
@@ -1551,18 +1549,17 @@ async function importKey(key, alg) {
|
|
|
1551
1549
|
return key;
|
|
1552
1550
|
}
|
|
1553
1551
|
if (isJWK(key)) {
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
return base64UrlDecode(safeJwk.k, false);
|
|
1552
|
+
if ("k" in key && typeof key.k === "string") {
|
|
1553
|
+
return base64UrlDecode(key.k, false);
|
|
1557
1554
|
} else {
|
|
1558
|
-
if (!
|
|
1555
|
+
if (!key.alg && !alg) {
|
|
1559
1556
|
throw new TypeError(
|
|
1560
1557
|
"Algorithm must be provided when importing non-oct JWK"
|
|
1561
1558
|
);
|
|
1562
1559
|
}
|
|
1563
1560
|
return jwkTokey({
|
|
1564
|
-
...
|
|
1565
|
-
alg:
|
|
1561
|
+
...key,
|
|
1562
|
+
alg: key.alg || alg
|
|
1566
1563
|
});
|
|
1567
1564
|
}
|
|
1568
1565
|
}
|
|
@@ -2017,18 +2014,10 @@ function getGenerateKeyParams(alg, options) {
|
|
|
2017
2014
|
break;
|
|
2018
2015
|
}
|
|
2019
2016
|
// ECDSA Signatures
|
|
2020
|
-
case "ES256":
|
|
2021
|
-
|
|
2022
|
-
keyUsages = defaultKeyUsage ?? ["sign", "verify"];
|
|
2023
|
-
break;
|
|
2024
|
-
}
|
|
2025
|
-
case "ES384": {
|
|
2026
|
-
algorithm = { name: "ECDSA", namedCurve: "P-384" };
|
|
2027
|
-
keyUsages = defaultKeyUsage ?? ["sign", "verify"];
|
|
2028
|
-
break;
|
|
2029
|
-
}
|
|
2017
|
+
case "ES256":
|
|
2018
|
+
case "ES384":
|
|
2030
2019
|
case "ES512": {
|
|
2031
|
-
algorithm = { name: "ECDSA", namedCurve:
|
|
2020
|
+
algorithm = { name: "ECDSA", namedCurve: `P-${alg.slice(2)}` };
|
|
2032
2021
|
keyUsages = defaultKeyUsage ?? ["sign", "verify"];
|
|
2033
2022
|
break;
|
|
2034
2023
|
}
|
|
@@ -2122,4 +2111,4 @@ const jwk = {
|
|
|
2122
2111
|
wrapKey: wrapKey
|
|
2123
2112
|
};
|
|
2124
2113
|
|
|
2125
|
-
export { encrypt as a, getJWKFromSet as b,
|
|
2114
|
+
export { encrypt as a, getJWKFromSet as b, generateJWK as c, decrypt as d, encryptKey as e, importJWKFromPEM as f, generateIV as g, exportJWKToPEM as h, importKey as i, jwk as j, deriveJWKFromPassword as k, generateKey as l, deriveKeyFromPassword as m, exportKey as n, sign as s, unwrapKey as u, verify as v, wrapKey as w };
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './shared/unjwt.
|
|
2
|
-
export { s as applyTypCtyDefaults, j as assertCryptoKey, d as base64Decode, b as base64Encode, e as base64UrlDecode, c as base64UrlEncode, z as computeExpiresInSeconds, B as computeJwtTimeClaims, A as computeMaxTokenAgeSeconds, f as concatUint8Arrays, v as decodeMaybeJWTString, x as decodePayloadFromB64UrlSegment, w as decodePayloadFromBytes, y as getPlaintextBytes, o as isAsymmetricJWK, k as isCryptoKey, l as isCryptoKeyPair, g as isJWK, h as isJWKSet, u as isJWTContent, p as isPrivateJWK, q as isPublicJWK, n as isSymmetricJWK, m as maybeArray, r as randomBytes, F as sanitizeObject, a as textDecoder, t as textEncoder, E as validateCriticalHeadersJWE, D as validateCriticalHeadersJWS, C as validateJwtClaims } from './shared/unjwt.
|
|
1
|
+
import './shared/unjwt.CtHrClHc.mjs';
|
|
2
|
+
export { s as applyTypCtyDefaults, j as assertCryptoKey, d as base64Decode, b as base64Encode, e as base64UrlDecode, c as base64UrlEncode, z as computeExpiresInSeconds, B as computeJwtTimeClaims, A as computeMaxTokenAgeSeconds, f as concatUint8Arrays, v as decodeMaybeJWTString, x as decodePayloadFromB64UrlSegment, w as decodePayloadFromBytes, y as getPlaintextBytes, o as isAsymmetricJWK, k as isCryptoKey, l as isCryptoKeyPair, g as isJWK, h as isJWKSet, u as isJWTContent, p as isPrivateJWK, q as isPublicJWK, n as isSymmetricJWK, m as maybeArray, r as randomBytes, F as sanitizeObject, a as textDecoder, t as textEncoder, E as validateCriticalHeadersJWE, D as validateCriticalHeadersJWS, C as validateJwtClaims } from './shared/unjwt.BrNGm4On.mjs';
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as applyTypCtyDefaults,
|
|
1
|
+
export { b as applyTypCtyDefaults, z as assertCryptoKey, x as base64Decode, y as base64Encode, e as base64UrlDecode, d as base64UrlEncode, E as computeExpiresInSeconds, c as computeJwtTimeClaims, F as computeMaxTokenAgeSeconds, w as concatUint8Arrays, D as decodeMaybeJWTString, n as decodePayloadFromB64UrlSegment, f as decodePayloadFromBytes, g as getPlaintextBytes, u as isAsymmetricJWK, k as isCryptoKey, j as isCryptoKeyPair, a as isJWK, m as isJWKSet, C as isJWTContent, q as isPrivateJWK, B as isPublicJWK, p as isSymmetricJWK, A as maybeArray, r as randomBytes, s as sanitizeObject, l as textDecoder, t as textEncoder, v as validateCriticalHeadersJWE, o as validateCriticalHeadersJWS, h as validateJwtClaims } from './shared/unjwt.DCiTNyCM.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unjwt",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
4
4
|
"description": "Low-level JWT utilities",
|
|
5
5
|
"repository": "sandros94/unjwt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"./utils": {
|
|
31
31
|
"types": "./dist/utils.d.mts",
|
|
32
32
|
"default": "./dist/utils.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./h3": {
|
|
35
|
+
"types": "./dist/h3.d.mts",
|
|
36
|
+
"default": "./dist/h3.mjs"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"main": "./dist/index.mjs",
|
|
@@ -52,6 +56,7 @@
|
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"@types/node": "^22",
|
|
59
|
+
"@types/supertest": "^6.0.3",
|
|
55
60
|
"@vitest/coverage-v8": "^3.2.4",
|
|
56
61
|
"automd": "^0.4.2",
|
|
57
62
|
"changelogen": "^0.6.2",
|
|
@@ -59,9 +64,22 @@
|
|
|
59
64
|
"eslint-config-unjs": "^0.5.0",
|
|
60
65
|
"jose": "^6.1.0",
|
|
61
66
|
"prettier": "^3.6.2",
|
|
67
|
+
"supertest": "^7.1.4",
|
|
62
68
|
"typescript": "^5.9.2",
|
|
63
69
|
"unbuild": "^3.6.1",
|
|
64
70
|
"vitest": "^3.2.4"
|
|
65
71
|
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"cookie-es": "^1.2.2 || ^2.0.0",
|
|
74
|
+
"h3": "^1.15.4 || ^2.0.0-rc.0 || ^2.0.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"cookie-es": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"h3": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
66
84
|
"packageManager": "pnpm@10.17.1"
|
|
67
85
|
}
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { K as KeyManagementAlgorithm, f as ContentEncryptionAlgorithm, E as ExpiresIn, S as JoseHeaderParameters, h as JWK_EC_Public, i as JWK_EC_Private, t as JWK, X as JWTClaimValidationOptions, T as JWTClaims, C as CompositeKey, D as DeriveKeyOptions, e as DeriveKeyReturn, c as GenerateJWKOptions, d as GenerateJWKReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, Q as JWKAlgorithm, R as JWKPEMAlgorithm, J as JWKParameters, u as JWKSet, F as JWK_AES_CBC_HMAC, H as JWK_AES_GCM, B as JWK_AES_GCM_KW, A as JWK_AES_KW, P as JWK_Asymmetric_Algorithm, j as JWK_EC, L as JWK_ECDH_ES, y as JWK_ECDSA, v as JWK_HMAC, p as JWK_OKP, o as JWK_OKP_Private, n as JWK_OKP_Public, N as JWK_OKP_SIGN, I as JWK_PBES2, s as JWK_Private, r as JWK_Public, m as JWK_RSA, z as JWK_RSA_ENC, x as JWK_RSA_PSS, l as JWK_RSA_Private, k as JWK_RSA_Public, w as JWK_RSA_SIGN, O as JWK_Symmetric_Algorithm, q as JWK_oct, V as JWT, U as UnwrapKeyOptions, W as WrapKeyOptions, g as WrapKeyResult } from './unjwt.Dy68jE0N.mjs';
|
|
2
|
-
|
|
3
|
-
/** Recognized JWE Header Parameters, any other Header Members may also be present. */
|
|
4
|
-
interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
5
|
-
/**
|
|
6
|
-
* `alg` (Algorithm): Header Parameter - Key Management Algorithm
|
|
7
|
-
*/
|
|
8
|
-
alg?: string;
|
|
9
|
-
/**
|
|
10
|
-
* `enc` (Encryption Algorithm): Header Parameter - Content Encryption Algorithm
|
|
11
|
-
*/
|
|
12
|
-
enc?: string;
|
|
13
|
-
/**
|
|
14
|
-
* `p2c` (PBES2 Count): Header Parameter
|
|
15
|
-
*/
|
|
16
|
-
p2c?: number;
|
|
17
|
-
/**
|
|
18
|
-
* `p2s` (PBES2 Salt): Header Parameter. Base64URL encoded.
|
|
19
|
-
*/
|
|
20
|
-
p2s?: string;
|
|
21
|
-
/**
|
|
22
|
-
* "iv" (Initialization Vector) Header Parameter for AES GCM Key Wrapping. Base64URL encoded.
|
|
23
|
-
*/
|
|
24
|
-
iv?: string;
|
|
25
|
-
/**
|
|
26
|
-
* "tag" (Authentication Tag) Header Parameter for AES GCM Key Wrapping. Base64URL encoded.
|
|
27
|
-
*/
|
|
28
|
-
tag?: string;
|
|
29
|
-
/**
|
|
30
|
-
* "epk" (Ephemeral Public Key) Header Parameter for ECDH-ES.
|
|
31
|
-
*/
|
|
32
|
-
epk?: JWK_EC_Public;
|
|
33
|
-
/**
|
|
34
|
-
* "apu" (Agreement PartyUInfo) Header Parameter for ECDH-ES. Base64URL encoded.
|
|
35
|
-
*/
|
|
36
|
-
apu?: string;
|
|
37
|
-
/**
|
|
38
|
-
* "apv" (Agreement PartyVInfo) Header Parameter for ECDH-ES. Base64URL encoded.
|
|
39
|
-
*/
|
|
40
|
-
apv?: string;
|
|
41
|
-
/** Any other JWE Header member. */
|
|
42
|
-
[propName: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
/** Recognized JWE Key Management-related Header Parameters. */
|
|
45
|
-
interface JWEKeyManagementHeaderParameters {
|
|
46
|
-
apu?: Uint8Array<ArrayBuffer>;
|
|
47
|
-
apv?: Uint8Array<ArrayBuffer>;
|
|
48
|
-
/**
|
|
49
|
-
* For Internal use only
|
|
50
|
-
*/
|
|
51
|
-
p2c?: number;
|
|
52
|
-
/**
|
|
53
|
-
* For Internal use only
|
|
54
|
-
*/
|
|
55
|
-
p2s?: Uint8Array<ArrayBuffer>;
|
|
56
|
-
/**
|
|
57
|
-
* For Internal use only
|
|
58
|
-
*/
|
|
59
|
-
iv?: Uint8Array<ArrayBuffer>;
|
|
60
|
-
/**
|
|
61
|
-
* For Internal use only
|
|
62
|
-
*/
|
|
63
|
-
epk?: CryptoKey | JWK_EC_Public;
|
|
64
|
-
/**
|
|
65
|
-
* For Internal use only
|
|
66
|
-
*/
|
|
67
|
-
epkPrivateKey?: CryptoKey | JWK_EC_Private;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* JWE (JSON Web Encryption) encryption options
|
|
71
|
-
*/
|
|
72
|
-
interface JWEEncryptOptions {
|
|
73
|
-
/** JWE "alg" (Algorithm) Header Parameter. Key Management Algorithm. */
|
|
74
|
-
alg?: KeyManagementAlgorithm;
|
|
75
|
-
/** JWE "enc" (Encryption Algorithm) Header Parameter. Content Encryption Algorithm. */
|
|
76
|
-
enc?: ContentEncryptionAlgorithm;
|
|
77
|
-
/** Date to use when computing NumericDate claims, defaults to `new Date()`. */
|
|
78
|
-
currentDate?: Date;
|
|
79
|
-
/** Time at which the JWT should expire, if no `exp` was already provided (only when typ is "JWT" or explicitly parsing JWT). */
|
|
80
|
-
expiresIn?: ExpiresIn;
|
|
81
|
-
/** Additional JWE Protected Header parameters. */
|
|
82
|
-
protectedHeader?: Omit<JWEHeaderParameters, "alg" | "enc" | "iv" | "tag" | "p2s" | "p2c" | "epk" | "apu" | "apv">;
|
|
83
|
-
/** Initialization Vector for AES-GCMKW key wrapping. Generated if not provided. */
|
|
84
|
-
keyManagementIV?: Uint8Array<ArrayBuffer>;
|
|
85
|
-
/** PBES2 Salt value (p2s). Required for PBES2 algorithms. */
|
|
86
|
-
p2s?: Uint8Array<ArrayBuffer>;
|
|
87
|
-
/** PBES2 Iteration count (p2c). Required for PBES2 algorithms. */
|
|
88
|
-
p2c?: number;
|
|
89
|
-
/** ECDH-ES specific options. */
|
|
90
|
-
ecdh?: {
|
|
91
|
-
/**
|
|
92
|
-
* ECDH-ES Ephemeral key material. Provide a private key (CryptoKey or JWK),
|
|
93
|
-
* a CryptoKeyPair, or an object exposing both public and private parts.
|
|
94
|
-
*/
|
|
95
|
-
ephemeralKey?: CryptoKey | JWK_EC_Private | CryptoKeyPair | {
|
|
96
|
-
publicKey: CryptoKey | JWK_EC_Public;
|
|
97
|
-
privateKey: CryptoKey | JWK_EC_Private;
|
|
98
|
-
};
|
|
99
|
-
/** ECDH-ES Agreement PartyUInfo. */
|
|
100
|
-
partyUInfo?: Uint8Array<ArrayBuffer>;
|
|
101
|
-
/** ECDH-ES Agreement PartyVInfo. */
|
|
102
|
-
partyVInfo?: Uint8Array<ArrayBuffer>;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Content Encryption Key (CEK) to use.
|
|
106
|
-
* If provided, it will be used directly. Otherwise, a CEK will be generated.
|
|
107
|
-
*/
|
|
108
|
-
cek?: Uint8Array<ArrayBuffer>;
|
|
109
|
-
/**
|
|
110
|
-
* Initialization Vector for content encryption.
|
|
111
|
-
* If provided, it will be used. Otherwise, one will be generated.
|
|
112
|
-
*/
|
|
113
|
-
contentEncryptionIV?: Uint8Array<ArrayBuffer>;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Key lookup function for JWE decryption.
|
|
117
|
-
* @param header The JWE Protected Header.
|
|
118
|
-
* @returns The key material (CryptoKey, JWK, password string, or raw Uint8Array) or a Promise resolving to it.
|
|
119
|
-
*/
|
|
120
|
-
type JWEKeyLookupFunction = (header: JWEHeaderParameters, token: string) => CryptoKey | JWK | string | Uint8Array<ArrayBuffer> | Promise<CryptoKey | JWK | string | Uint8Array<ArrayBuffer>>;
|
|
121
|
-
/**
|
|
122
|
-
* JWE (JSON Web Encryption) decryption options
|
|
123
|
-
*/
|
|
124
|
-
interface JWEDecryptOptions extends JWTClaimValidationOptions {
|
|
125
|
-
/** A list of allowed JWE "alg" (Algorithm) Header Parameter values for key management. */
|
|
126
|
-
algorithms?: KeyManagementAlgorithm[];
|
|
127
|
-
/** A list of allowed JWE "enc" (Encryption Algorithm) Header Parameter values for content encryption. */
|
|
128
|
-
encryptionAlgorithms?: ContentEncryptionAlgorithm[];
|
|
129
|
-
/** Algorithm to import the unwrapped CEK as (e.g., { name: 'AES-GCM' }). Defaults based on 'enc'. */
|
|
130
|
-
unwrappedKeyAlgorithm?: Parameters<typeof crypto.subtle.importKey>[2];
|
|
131
|
-
/** Key usages for the unwrapped CEK. Defaults based on 'enc' (typically ['encrypt', 'decrypt']). */
|
|
132
|
-
keyUsage?: KeyUsage[];
|
|
133
|
-
/** Mark the unwrapped CEK as extractable. Defaults to true. */
|
|
134
|
-
extractable?: boolean;
|
|
135
|
-
/** If true, forces the payload to be returned as a Uint8Array, otherwise type is inferred based on JWE headers. */
|
|
136
|
-
forceUint8Array?: boolean;
|
|
137
|
-
/** Unless false, will parse payload as JWT and validate claims if applicable (typ "JWT"). */
|
|
138
|
-
validateJWT?: boolean;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Result of a JWE decryption operation.
|
|
142
|
-
*/
|
|
143
|
-
interface JWEDecryptResult<T extends JWTClaims | Uint8Array<ArrayBuffer> | string = JWTClaims | Uint8Array<ArrayBuffer> | string> {
|
|
144
|
-
/** The decrypted payload. */
|
|
145
|
-
payload: T;
|
|
146
|
-
/** The JWE Protected Header. */
|
|
147
|
-
protectedHeader: JWEHeaderParameters;
|
|
148
|
-
/** The Content Encryption Key (CEK) used for decryption, as Uint8Array. */
|
|
149
|
-
cek: Uint8Array<ArrayBuffer>;
|
|
150
|
-
/** The Additional Authenticated Data (AAD) used, as Uint8Array. */
|
|
151
|
-
aad: Uint8Array<ArrayBuffer>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Encrypts a payload to produce a JWE Compact Serialization string.
|
|
156
|
-
*
|
|
157
|
-
* @param payload The payload to encrypt. Can be a string, Uint8Array, or a JSON-serializable object.
|
|
158
|
-
* @param key The key encryption key (KEK). Can be a CryptoKey, JWK, or for PBES2, a password string/Uint8Array.
|
|
159
|
-
* @param options JWE encryption options, including `alg` (key management algorithm) and `enc` (content encryption algorithm).
|
|
160
|
-
* @returns A Promise resolving to the JWE Compact Serialization string.
|
|
161
|
-
*/
|
|
162
|
-
declare function encrypt(payload: JWTClaims, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
163
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: JWK | string | Uint8Array<ArrayBuffer>, options?: JWEEncryptOptions): Promise<string>;
|
|
164
|
-
declare function encrypt(payload: JWTClaims, key: CryptoKey, options: JWEEncryptOptions & {
|
|
165
|
-
alg: KeyManagementAlgorithm;
|
|
166
|
-
enc: ContentEncryptionAlgorithm;
|
|
167
|
-
}): Promise<string>;
|
|
168
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey, options: JWEEncryptOptions & {
|
|
169
|
-
alg: KeyManagementAlgorithm;
|
|
170
|
-
enc: ContentEncryptionAlgorithm;
|
|
171
|
-
}): Promise<string>;
|
|
172
|
-
declare function encrypt(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey | JWK | string | Uint8Array<ArrayBuffer>, options: JWEEncryptOptions & {
|
|
173
|
-
alg: KeyManagementAlgorithm;
|
|
174
|
-
enc: ContentEncryptionAlgorithm;
|
|
175
|
-
}): Promise<string>;
|
|
176
|
-
/**
|
|
177
|
-
* Decrypts a JWE Compact Serialization string.
|
|
178
|
-
*
|
|
179
|
-
* @param jwe The JWE Compact Serialization string.
|
|
180
|
-
* @param key The key decryption key (KEK) or a function to look up the key.
|
|
181
|
-
* @param options JWE decryption options.
|
|
182
|
-
* @returns A Promise resolving to an object containing the decrypted plaintext, protected header, CEK, and AAD.
|
|
183
|
-
* @throws If JWE is invalid, decryption fails, or options are not met.
|
|
184
|
-
*/
|
|
185
|
-
declare function decrypt<T extends JWTClaims | Uint8Array<ArrayBuffer> | string>(jwe: string, key: CryptoKey | JWK | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options?: JWEDecryptOptions): Promise<JWEDecryptResult<T>>;
|
|
186
|
-
declare function decrypt(jwe: string, key: CryptoKey | JWK | string | Uint8Array<ArrayBuffer> | JWEKeyLookupFunction, options: JWEDecryptOptions & {
|
|
187
|
-
forceUint8Array: true;
|
|
188
|
-
}): Promise<JWEDecryptResult<Uint8Array<ArrayBuffer>>>;
|
|
189
|
-
|
|
190
|
-
declare const jwe_CompositeKey: typeof CompositeKey;
|
|
191
|
-
declare const jwe_ContentEncryptionAlgorithm: typeof ContentEncryptionAlgorithm;
|
|
192
|
-
declare const jwe_DeriveKeyOptions: typeof DeriveKeyOptions;
|
|
193
|
-
declare const jwe_DeriveKeyReturn: typeof DeriveKeyReturn;
|
|
194
|
-
declare const jwe_GenerateJWKOptions: typeof GenerateJWKOptions;
|
|
195
|
-
declare const jwe_GenerateJWKReturn: typeof GenerateJWKReturn;
|
|
196
|
-
declare const jwe_GenerateKeyAlgorithm: typeof GenerateKeyAlgorithm;
|
|
197
|
-
declare const jwe_GenerateKeyOptions: typeof GenerateKeyOptions;
|
|
198
|
-
declare const jwe_GenerateKeyReturn: typeof GenerateKeyReturn;
|
|
199
|
-
type jwe_JWEDecryptOptions = JWEDecryptOptions;
|
|
200
|
-
type jwe_JWEDecryptResult<T extends JWTClaims | Uint8Array<ArrayBuffer> | string = JWTClaims | Uint8Array<ArrayBuffer> | string> = JWEDecryptResult<T>;
|
|
201
|
-
type jwe_JWEEncryptOptions = JWEEncryptOptions;
|
|
202
|
-
type jwe_JWEHeaderParameters = JWEHeaderParameters;
|
|
203
|
-
type jwe_JWEKeyLookupFunction = JWEKeyLookupFunction;
|
|
204
|
-
type jwe_JWEKeyManagementHeaderParameters = JWEKeyManagementHeaderParameters;
|
|
205
|
-
declare const jwe_JWK: typeof JWK;
|
|
206
|
-
declare const jwe_JWKAlgorithm: typeof JWKAlgorithm;
|
|
207
|
-
declare const jwe_JWKPEMAlgorithm: typeof JWKPEMAlgorithm;
|
|
208
|
-
declare const jwe_JWKParameters: typeof JWKParameters;
|
|
209
|
-
declare const jwe_JWKSet: typeof JWKSet;
|
|
210
|
-
declare const jwe_JWK_AES_CBC_HMAC: typeof JWK_AES_CBC_HMAC;
|
|
211
|
-
declare const jwe_JWK_AES_GCM: typeof JWK_AES_GCM;
|
|
212
|
-
declare const jwe_JWK_AES_GCM_KW: typeof JWK_AES_GCM_KW;
|
|
213
|
-
declare const jwe_JWK_AES_KW: typeof JWK_AES_KW;
|
|
214
|
-
declare const jwe_JWK_Asymmetric_Algorithm: typeof JWK_Asymmetric_Algorithm;
|
|
215
|
-
declare const jwe_JWK_EC: typeof JWK_EC;
|
|
216
|
-
declare const jwe_JWK_ECDH_ES: typeof JWK_ECDH_ES;
|
|
217
|
-
declare const jwe_JWK_ECDSA: typeof JWK_ECDSA;
|
|
218
|
-
declare const jwe_JWK_EC_Private: typeof JWK_EC_Private;
|
|
219
|
-
declare const jwe_JWK_EC_Public: typeof JWK_EC_Public;
|
|
220
|
-
declare const jwe_JWK_HMAC: typeof JWK_HMAC;
|
|
221
|
-
declare const jwe_JWK_OKP: typeof JWK_OKP;
|
|
222
|
-
declare const jwe_JWK_OKP_Private: typeof JWK_OKP_Private;
|
|
223
|
-
declare const jwe_JWK_OKP_Public: typeof JWK_OKP_Public;
|
|
224
|
-
declare const jwe_JWK_OKP_SIGN: typeof JWK_OKP_SIGN;
|
|
225
|
-
declare const jwe_JWK_PBES2: typeof JWK_PBES2;
|
|
226
|
-
declare const jwe_JWK_Private: typeof JWK_Private;
|
|
227
|
-
declare const jwe_JWK_Public: typeof JWK_Public;
|
|
228
|
-
declare const jwe_JWK_RSA: typeof JWK_RSA;
|
|
229
|
-
declare const jwe_JWK_RSA_ENC: typeof JWK_RSA_ENC;
|
|
230
|
-
declare const jwe_JWK_RSA_PSS: typeof JWK_RSA_PSS;
|
|
231
|
-
declare const jwe_JWK_RSA_Private: typeof JWK_RSA_Private;
|
|
232
|
-
declare const jwe_JWK_RSA_Public: typeof JWK_RSA_Public;
|
|
233
|
-
declare const jwe_JWK_RSA_SIGN: typeof JWK_RSA_SIGN;
|
|
234
|
-
declare const jwe_JWK_Symmetric_Algorithm: typeof JWK_Symmetric_Algorithm;
|
|
235
|
-
declare const jwe_JWK_oct: typeof JWK_oct;
|
|
236
|
-
declare const jwe_JWT: typeof JWT;
|
|
237
|
-
declare const jwe_JWTClaimValidationOptions: typeof JWTClaimValidationOptions;
|
|
238
|
-
declare const jwe_JWTClaims: typeof JWTClaims;
|
|
239
|
-
declare const jwe_JoseHeaderParameters: typeof JoseHeaderParameters;
|
|
240
|
-
declare const jwe_KeyManagementAlgorithm: typeof KeyManagementAlgorithm;
|
|
241
|
-
declare const jwe_UnwrapKeyOptions: typeof UnwrapKeyOptions;
|
|
242
|
-
declare const jwe_WrapKeyOptions: typeof WrapKeyOptions;
|
|
243
|
-
declare const jwe_WrapKeyResult: typeof WrapKeyResult;
|
|
244
|
-
declare const jwe_decrypt: typeof decrypt;
|
|
245
|
-
declare const jwe_encrypt: typeof encrypt;
|
|
246
|
-
declare namespace jwe {
|
|
247
|
-
export { jwe_CompositeKey as CompositeKey, jwe_ContentEncryptionAlgorithm as ContentEncryptionAlgorithm, jwe_DeriveKeyOptions as DeriveKeyOptions, jwe_DeriveKeyReturn as DeriveKeyReturn, jwe_GenerateJWKOptions as GenerateJWKOptions, jwe_GenerateJWKReturn as GenerateJWKReturn, jwe_GenerateKeyAlgorithm as GenerateKeyAlgorithm, jwe_GenerateKeyOptions as GenerateKeyOptions, jwe_GenerateKeyReturn as GenerateKeyReturn, jwe_JWK as JWK, jwe_JWKAlgorithm as JWKAlgorithm, jwe_JWKPEMAlgorithm as JWKPEMAlgorithm, jwe_JWKParameters as JWKParameters, jwe_JWKSet as JWKSet, jwe_JWK_AES_CBC_HMAC as JWK_AES_CBC_HMAC, jwe_JWK_AES_GCM as JWK_AES_GCM, jwe_JWK_AES_GCM_KW as JWK_AES_GCM_KW, jwe_JWK_AES_KW as JWK_AES_KW, jwe_JWK_Asymmetric_Algorithm as JWK_Asymmetric_Algorithm, jwe_JWK_EC as JWK_EC, jwe_JWK_ECDH_ES as JWK_ECDH_ES, jwe_JWK_ECDSA as JWK_ECDSA, jwe_JWK_EC_Private as JWK_EC_Private, jwe_JWK_EC_Public as JWK_EC_Public, jwe_JWK_HMAC as JWK_HMAC, jwe_JWK_OKP as JWK_OKP, jwe_JWK_OKP_Private as JWK_OKP_Private, jwe_JWK_OKP_Public as JWK_OKP_Public, jwe_JWK_OKP_SIGN as JWK_OKP_SIGN, jwe_JWK_PBES2 as JWK_PBES2, jwe_JWK_Private as JWK_Private, jwe_JWK_Public as JWK_Public, jwe_JWK_RSA as JWK_RSA, jwe_JWK_RSA_ENC as JWK_RSA_ENC, jwe_JWK_RSA_PSS as JWK_RSA_PSS, jwe_JWK_RSA_Private as JWK_RSA_Private, jwe_JWK_RSA_Public as JWK_RSA_Public, jwe_JWK_RSA_SIGN as JWK_RSA_SIGN, jwe_JWK_Symmetric_Algorithm as JWK_Symmetric_Algorithm, jwe_JWK_oct as JWK_oct, jwe_JWT as JWT, jwe_JWTClaimValidationOptions as JWTClaimValidationOptions, jwe_JWTClaims as JWTClaims, jwe_JoseHeaderParameters as JoseHeaderParameters, jwe_KeyManagementAlgorithm as KeyManagementAlgorithm, jwe_UnwrapKeyOptions as UnwrapKeyOptions, jwe_WrapKeyOptions as WrapKeyOptions, jwe_WrapKeyResult as WrapKeyResult, jwe_decrypt as decrypt, jwe_encrypt as encrypt };
|
|
248
|
-
export type { jwe_JWEDecryptOptions as JWEDecryptOptions, jwe_JWEDecryptResult as JWEDecryptResult, jwe_JWEEncryptOptions as JWEEncryptOptions, jwe_JWEHeaderParameters as JWEHeaderParameters, jwe_JWEKeyLookupFunction as JWEKeyLookupFunction, jwe_JWEKeyManagementHeaderParameters as JWEKeyManagementHeaderParameters };
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export { encrypt as f, decrypt as g, jwe as j };
|
|
252
|
-
export type { JWEHeaderParameters as J, JWEKeyManagementHeaderParameters as a, JWEEncryptOptions as b, JWEKeyLookupFunction as c, JWEDecryptOptions as d, JWEDecryptResult as e };
|