unjwt 0.5.15 → 0.5.16
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 +2 -2
- package/dist/index.d.mts +5 -5
- package/dist/jwe.d.mts +2 -2
- package/dist/jwk.d.mts +2 -2
- package/dist/jws.d.mts +2 -2
- package/dist/shared/{unjwt.BeWVYyaf.d.mts → unjwt.BkUfaQRR.d.mts} +44 -2
- package/dist/shared/{unjwt.C6b_GyXm.d.mts → unjwt.CbxAdgsb.d.mts} +1 -1
- package/dist/shared/{unjwt.CfL4cArP.d.mts → unjwt.DUVOOOvO.d.mts} +3 -3
- package/dist/shared/{unjwt.BsgIQHVD.d.mts → unjwt.OzI0aGB_.d.mts} +1 -1
- package/dist/shared/{unjwt.Bw4pzdE0.d.mts → unjwt.r8lbwWSJ.d.mts} +44 -2
- package/dist/utils.d.mts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,9 +123,9 @@ Returns a `Promise<string>` resolving to the JWS token in Compact Serialization
|
|
|
123
123
|
import { sign } from "unjwt/jws";
|
|
124
124
|
|
|
125
125
|
const payload = { message: "My important data" }; // Object payload
|
|
126
|
-
const
|
|
126
|
+
const key = await generateKey("HS256", { toJWK: true }); // Generates a JWK_oct
|
|
127
127
|
|
|
128
|
-
const token = await sign(payload,
|
|
128
|
+
const token = await sign(payload, key);
|
|
129
129
|
|
|
130
130
|
console.log(token);
|
|
131
131
|
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.
|
|
2
|
-
export { J as JWSAlgorithm, a as JWSHeaderParameters, f as JWSKeyLookupFunction, b as JWSProtectedHeader, c as JWSSignOptions, e as JWSVerifyOptions, d as JWSVerifyResult, j as jws } from './shared/unjwt.
|
|
3
|
-
export { d as JWEDecryptOptions, e as JWEDecryptResult, b as JWEEncryptOptions, J as JWEHeaderParameters, c as JWEKeyLookupFunction, a as JWEKeyManagementHeaderParameters, j as jwe } from './shared/unjwt.
|
|
4
|
-
export { i as utils } from './shared/unjwt.
|
|
5
|
-
export { j as jwk } from './shared/unjwt.
|
|
1
|
+
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.OzI0aGB_.mjs';
|
|
2
|
+
export { J as JWSAlgorithm, a as JWSHeaderParameters, f as JWSKeyLookupFunction, b as JWSProtectedHeader, c as JWSSignOptions, e as JWSVerifyOptions, d as JWSVerifyResult, j as jws } from './shared/unjwt.r8lbwWSJ.mjs';
|
|
3
|
+
export { d as JWEDecryptOptions, e as JWEDecryptResult, b as JWEEncryptOptions, J as JWEHeaderParameters, c as JWEKeyLookupFunction, a as JWEKeyManagementHeaderParameters, j as jwe } from './shared/unjwt.BkUfaQRR.mjs';
|
|
4
|
+
export { i as utils } from './shared/unjwt.DUVOOOvO.mjs';
|
|
5
|
+
export { j as jwk } from './shared/unjwt.CbxAdgsb.mjs';
|
package/dist/jwe.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters } from './shared/unjwt.
|
|
2
|
-
export { d as JWEDecryptOptions, e as JWEDecryptResult, b as JWEEncryptOptions, J as JWEHeaderParameters, c as JWEKeyLookupFunction, a as JWEKeyManagementHeaderParameters, g as decrypt, f as encrypt } from './shared/unjwt.
|
|
1
|
+
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.OzI0aGB_.mjs';
|
|
2
|
+
export { d as JWEDecryptOptions, e as JWEDecryptResult, b as JWEEncryptOptions, J as JWEHeaderParameters, c as JWEKeyLookupFunction, a as JWEKeyManagementHeaderParameters, g as decrypt, f as encrypt } from './shared/unjwt.BkUfaQRR.mjs';
|
package/dist/jwk.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.
|
|
2
|
-
export { d as deriveKeyFromPassword, b as exportJWKToPEM, e as exportKey, g as generateKey, c as getJWKFromSet, a as importJWKFromPEM, i as importKey, u as unwrapKey, w as wrapKey } from './shared/unjwt.
|
|
1
|
+
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.OzI0aGB_.mjs';
|
|
2
|
+
export { d as deriveKeyFromPassword, b as exportJWKToPEM, e as exportKey, g as generateKey, c as getJWKFromSet, a as importJWKFromPEM, i as importKey, u as unwrapKey, w as wrapKey } from './shared/unjwt.CbxAdgsb.mjs';
|
package/dist/jws.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters } from './shared/unjwt.
|
|
2
|
-
export { J as JWSAlgorithm, a as JWSHeaderParameters, f as JWSKeyLookupFunction, b as JWSProtectedHeader, c as JWSSignOptions, e as JWSVerifyOptions, d as JWSVerifyResult, s as sign, v as verify } from './shared/unjwt.
|
|
1
|
+
export { C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, r as JWK, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims, O as JoseHeaderParameters, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './shared/unjwt.OzI0aGB_.mjs';
|
|
2
|
+
export { J as JWSAlgorithm, a as JWSHeaderParameters, f as JWSKeyLookupFunction, b as JWSProtectedHeader, c as JWSSignOptions, e as JWSVerifyOptions, d as JWSVerifyResult, s as sign, v as verify } from './shared/unjwt.r8lbwWSJ.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as KeyManagementAlgorithm, d as ContentEncryptionAlgorithm, O as JoseHeaderParameters, f as JWK_EC_Public, r as JWK, R as JWTClaimValidationOptions, P as JWTClaims, Q as JWT } from './unjwt.
|
|
1
|
+
import { K as KeyManagementAlgorithm, d as ContentEncryptionAlgorithm, O as JoseHeaderParameters, f as JWK_EC_Public, r as JWK, R as JWTClaimValidationOptions, P as JWTClaims, C as CompositeKey, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, s as JWKSet, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './unjwt.OzI0aGB_.mjs';
|
|
2
2
|
|
|
3
3
|
/** Recognized JWE Header Parameters, any other Header Members may also be present. */
|
|
4
4
|
interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
@@ -172,20 +172,62 @@ declare function decrypt(jwe: string, key: CryptoKey | JWK | string | Uint8Array
|
|
|
172
172
|
forceUint8Array: true;
|
|
173
173
|
}): Promise<JWEDecryptResult<Uint8Array<ArrayBuffer>>>;
|
|
174
174
|
|
|
175
|
+
declare const jwe_CompositeKey: typeof CompositeKey;
|
|
176
|
+
declare const jwe_ContentEncryptionAlgorithm: typeof ContentEncryptionAlgorithm;
|
|
177
|
+
declare const jwe_DeriveKeyOptions: typeof DeriveKeyOptions;
|
|
178
|
+
declare const jwe_DeriveKeyReturn: typeof DeriveKeyReturn;
|
|
179
|
+
declare const jwe_GenerateKeyAlgorithm: typeof GenerateKeyAlgorithm;
|
|
180
|
+
declare const jwe_GenerateKeyOptions: typeof GenerateKeyOptions;
|
|
181
|
+
declare const jwe_GenerateKeyReturn: typeof GenerateKeyReturn;
|
|
175
182
|
type jwe_JWEDecryptOptions = JWEDecryptOptions;
|
|
176
183
|
type jwe_JWEDecryptResult<T extends JWTClaims | Uint8Array<ArrayBuffer> | string = JWTClaims | Uint8Array<ArrayBuffer> | string> = JWEDecryptResult<T>;
|
|
177
184
|
type jwe_JWEEncryptOptions = JWEEncryptOptions;
|
|
178
185
|
type jwe_JWEHeaderParameters = JWEHeaderParameters;
|
|
179
186
|
type jwe_JWEKeyLookupFunction = JWEKeyLookupFunction;
|
|
180
187
|
type jwe_JWEKeyManagementHeaderParameters = JWEKeyManagementHeaderParameters;
|
|
188
|
+
declare const jwe_JWK: typeof JWK;
|
|
189
|
+
declare const jwe_JWKAlgorithm: typeof JWKAlgorithm;
|
|
190
|
+
declare const jwe_JWKPEMAlgorithm: typeof JWKPEMAlgorithm;
|
|
191
|
+
declare const jwe_JWKParameters: typeof JWKParameters;
|
|
192
|
+
declare const jwe_JWKSet: typeof JWKSet;
|
|
193
|
+
declare const jwe_JWK_AES_CBC_HMAC: typeof JWK_AES_CBC_HMAC;
|
|
194
|
+
declare const jwe_JWK_AES_GCM: typeof JWK_AES_GCM;
|
|
195
|
+
declare const jwe_JWK_AES_GCM_KW: typeof JWK_AES_GCM_KW;
|
|
196
|
+
declare const jwe_JWK_AES_KW: typeof JWK_AES_KW;
|
|
197
|
+
declare const jwe_JWK_Asymmetric_Algorithm: typeof JWK_Asymmetric_Algorithm;
|
|
198
|
+
declare const jwe_JWK_EC: typeof JWK_EC;
|
|
199
|
+
declare const jwe_JWK_ECDH_ES: typeof JWK_ECDH_ES;
|
|
200
|
+
declare const jwe_JWK_ECDSA: typeof JWK_ECDSA;
|
|
201
|
+
declare const jwe_JWK_EC_Private: typeof JWK_EC_Private;
|
|
202
|
+
declare const jwe_JWK_EC_Public: typeof JWK_EC_Public;
|
|
203
|
+
declare const jwe_JWK_HMAC: typeof JWK_HMAC;
|
|
204
|
+
declare const jwe_JWK_OKP: typeof JWK_OKP;
|
|
205
|
+
declare const jwe_JWK_OKP_Private: typeof JWK_OKP_Private;
|
|
206
|
+
declare const jwe_JWK_OKP_Public: typeof JWK_OKP_Public;
|
|
207
|
+
declare const jwe_JWK_OKP_SIGN: typeof JWK_OKP_SIGN;
|
|
208
|
+
declare const jwe_JWK_PBES2: typeof JWK_PBES2;
|
|
209
|
+
declare const jwe_JWK_Private: typeof JWK_Private;
|
|
210
|
+
declare const jwe_JWK_Public: typeof JWK_Public;
|
|
211
|
+
declare const jwe_JWK_RSA: typeof JWK_RSA;
|
|
212
|
+
declare const jwe_JWK_RSA_ENC: typeof JWK_RSA_ENC;
|
|
213
|
+
declare const jwe_JWK_RSA_PSS: typeof JWK_RSA_PSS;
|
|
214
|
+
declare const jwe_JWK_RSA_Private: typeof JWK_RSA_Private;
|
|
215
|
+
declare const jwe_JWK_RSA_Public: typeof JWK_RSA_Public;
|
|
216
|
+
declare const jwe_JWK_RSA_SIGN: typeof JWK_RSA_SIGN;
|
|
217
|
+
declare const jwe_JWK_Symmetric_Algorithm: typeof JWK_Symmetric_Algorithm;
|
|
218
|
+
declare const jwe_JWK_oct: typeof JWK_oct;
|
|
181
219
|
declare const jwe_JWT: typeof JWT;
|
|
182
220
|
declare const jwe_JWTClaimValidationOptions: typeof JWTClaimValidationOptions;
|
|
183
221
|
declare const jwe_JWTClaims: typeof JWTClaims;
|
|
184
222
|
declare const jwe_JoseHeaderParameters: typeof JoseHeaderParameters;
|
|
223
|
+
declare const jwe_KeyManagementAlgorithm: typeof KeyManagementAlgorithm;
|
|
224
|
+
declare const jwe_UnwrapKeyOptions: typeof UnwrapKeyOptions;
|
|
225
|
+
declare const jwe_WrapKeyOptions: typeof WrapKeyOptions;
|
|
226
|
+
declare const jwe_WrapKeyResult: typeof WrapKeyResult;
|
|
185
227
|
declare const jwe_decrypt: typeof decrypt;
|
|
186
228
|
declare const jwe_encrypt: typeof encrypt;
|
|
187
229
|
declare namespace jwe {
|
|
188
|
-
export { jwe_JWT as JWT, jwe_JWTClaimValidationOptions as JWTClaimValidationOptions, jwe_JWTClaims as JWTClaims, jwe_JoseHeaderParameters as JoseHeaderParameters, jwe_decrypt as decrypt, jwe_encrypt as encrypt };
|
|
230
|
+
export { jwe_CompositeKey as CompositeKey, jwe_ContentEncryptionAlgorithm as ContentEncryptionAlgorithm, jwe_DeriveKeyOptions as DeriveKeyOptions, jwe_DeriveKeyReturn as DeriveKeyReturn, 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 };
|
|
189
231
|
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 };
|
|
190
232
|
}
|
|
191
233
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, E as JWK_PBES2, D as DeriveKeyOptions, c as DeriveKeyReturn, o as JWK_oct, r as JWK, K as KeyManagementAlgorithm, W as WrapKeyOptions, e as WrapKeyResult, U as UnwrapKeyOptions, N as JWKPEMAlgorithm, s as JWKSet, O as JoseHeaderParameters, C as CompositeKey, d as ContentEncryptionAlgorithm, M as JWKAlgorithm, J as JWKParameters, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims } from './unjwt.
|
|
1
|
+
import { G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, E as JWK_PBES2, D as DeriveKeyOptions, c as DeriveKeyReturn, o as JWK_oct, r as JWK, K as KeyManagementAlgorithm, W as WrapKeyOptions, e as WrapKeyResult, U as UnwrapKeyOptions, N as JWKPEMAlgorithm, s as JWKSet, O as JoseHeaderParameters, C as CompositeKey, d as ContentEncryptionAlgorithm, M as JWKAlgorithm, J as JWKParameters, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, w as JWK_ECDSA, g as JWK_EC_Private, f as JWK_EC_Public, t as JWK_HMAC, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, v as JWK_RSA_PSS, j as JWK_RSA_Private, i as JWK_RSA_Public, u as JWK_RSA_SIGN, I as JWK_Symmetric_Algorithm, Q as JWT, R as JWTClaimValidationOptions, P as JWTClaims } from './unjwt.OzI0aGB_.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This is a fork of Jose library's utility functions.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as JWTClaims, R as JWTClaimValidationOptions, r as JWK, s as JWKSet, o as JWK_oct, q as JWK_Private, p as JWK_Public } from './unjwt.
|
|
1
|
+
import { P as JWTClaims, R as JWTClaimValidationOptions, r as JWK, s as JWKSet, o as JWK_oct, q as JWK_Private, p as JWK_Public } from './unjwt.OzI0aGB_.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Apply default typ/cty semantics shared by JWS & JWE.
|
|
@@ -85,9 +85,9 @@ declare function assertCryptoKey(key: unknown): asserts key is CryptoKey;
|
|
|
85
85
|
declare function isCryptoKey(key: unknown): key is CryptoKey;
|
|
86
86
|
declare const isCryptoKeyPair: (key: any) => key is CryptoKeyPair;
|
|
87
87
|
/** Returns true if the JWK is a symmetric (oct) key. */
|
|
88
|
-
declare function isSymmetricJWK(key: unknown): key is JWK_oct
|
|
88
|
+
declare function isSymmetricJWK(key: unknown): key is Extract<JWK, JWK_oct>;
|
|
89
89
|
/** Returns true if the JWK is an asymmetric (RSA, EC, OKP) key. */
|
|
90
|
-
declare function isAsymmetricJWK(key: unknown): key is JWK_oct
|
|
90
|
+
declare function isAsymmetricJWK(key: unknown): key is Exclude<JWK, JWK_oct>;
|
|
91
91
|
/**
|
|
92
92
|
* Type guard that checks if the provided JWK contains private key material.
|
|
93
93
|
* It relies purely on the presence of private components (e.g. "d"), not on the alg value.
|
|
@@ -198,7 +198,7 @@ interface JWK_oct extends JWKParameters {
|
|
|
198
198
|
k: string;
|
|
199
199
|
}
|
|
200
200
|
/** Public JSON Web Keys */
|
|
201
|
-
type JWK_Public = JWK_RSA_Public | JWK_EC_Public | JWK_OKP_Public
|
|
201
|
+
type JWK_Public = JWK_RSA_Public | JWK_EC_Public | JWK_OKP_Public;
|
|
202
202
|
/** Private JSON Web Keys */
|
|
203
203
|
type JWK_Private = JWK_RSA_Private | JWK_EC_Private | JWK_OKP_Private;
|
|
204
204
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as JWK_HMAC, u as JWK_RSA_SIGN, v as JWK_RSA_PSS, w as JWK_ECDSA, O as JoseHeaderParameters, r as JWK, s as JWKSet, R as JWTClaimValidationOptions, P as JWTClaims, Q as JWT } from './unjwt.
|
|
1
|
+
import { t as JWK_HMAC, u as JWK_RSA_SIGN, v as JWK_RSA_PSS, w as JWK_ECDSA, O as JoseHeaderParameters, r as JWK, s as JWKSet, R as JWTClaimValidationOptions, P as JWTClaims, C as CompositeKey, d as ContentEncryptionAlgorithm, D as DeriveKeyOptions, c as DeriveKeyReturn, G as GenerateKeyAlgorithm, a as GenerateKeyOptions, b as GenerateKeyReturn, M as JWKAlgorithm, N as JWKPEMAlgorithm, J as JWKParameters, A as JWK_AES_CBC_HMAC, B as JWK_AES_GCM, z as JWK_AES_GCM_KW, y as JWK_AES_KW, L as JWK_Asymmetric_Algorithm, h as JWK_EC, F as JWK_ECDH_ES, g as JWK_EC_Private, f as JWK_EC_Public, n as JWK_OKP, m as JWK_OKP_Private, l as JWK_OKP_Public, H as JWK_OKP_SIGN, E as JWK_PBES2, q as JWK_Private, p as JWK_Public, k as JWK_RSA, x as JWK_RSA_ENC, j as JWK_RSA_Private, i as JWK_RSA_Public, I as JWK_Symmetric_Algorithm, o as JWK_oct, Q as JWT, K as KeyManagementAlgorithm, U as UnwrapKeyOptions, W as WrapKeyOptions, e as WrapKeyResult } from './unjwt.OzI0aGB_.mjs';
|
|
2
2
|
|
|
3
3
|
type JWS_SIGN_EXTRA = "Ed25519" | "EdDSA";
|
|
4
4
|
/** JWS Signing Algorithm Identifier. */
|
|
@@ -100,6 +100,44 @@ declare function verify(jws: string, key: CryptoKey | JWK | JWKSet | Uint8Array<
|
|
|
100
100
|
forceUint8Array: true;
|
|
101
101
|
}): Promise<JWSVerifyResult<Uint8Array<ArrayBuffer>>>;
|
|
102
102
|
|
|
103
|
+
declare const jws_CompositeKey: typeof CompositeKey;
|
|
104
|
+
declare const jws_ContentEncryptionAlgorithm: typeof ContentEncryptionAlgorithm;
|
|
105
|
+
declare const jws_DeriveKeyOptions: typeof DeriveKeyOptions;
|
|
106
|
+
declare const jws_DeriveKeyReturn: typeof DeriveKeyReturn;
|
|
107
|
+
declare const jws_GenerateKeyAlgorithm: typeof GenerateKeyAlgorithm;
|
|
108
|
+
declare const jws_GenerateKeyOptions: typeof GenerateKeyOptions;
|
|
109
|
+
declare const jws_GenerateKeyReturn: typeof GenerateKeyReturn;
|
|
110
|
+
declare const jws_JWK: typeof JWK;
|
|
111
|
+
declare const jws_JWKAlgorithm: typeof JWKAlgorithm;
|
|
112
|
+
declare const jws_JWKPEMAlgorithm: typeof JWKPEMAlgorithm;
|
|
113
|
+
declare const jws_JWKParameters: typeof JWKParameters;
|
|
114
|
+
declare const jws_JWKSet: typeof JWKSet;
|
|
115
|
+
declare const jws_JWK_AES_CBC_HMAC: typeof JWK_AES_CBC_HMAC;
|
|
116
|
+
declare const jws_JWK_AES_GCM: typeof JWK_AES_GCM;
|
|
117
|
+
declare const jws_JWK_AES_GCM_KW: typeof JWK_AES_GCM_KW;
|
|
118
|
+
declare const jws_JWK_AES_KW: typeof JWK_AES_KW;
|
|
119
|
+
declare const jws_JWK_Asymmetric_Algorithm: typeof JWK_Asymmetric_Algorithm;
|
|
120
|
+
declare const jws_JWK_EC: typeof JWK_EC;
|
|
121
|
+
declare const jws_JWK_ECDH_ES: typeof JWK_ECDH_ES;
|
|
122
|
+
declare const jws_JWK_ECDSA: typeof JWK_ECDSA;
|
|
123
|
+
declare const jws_JWK_EC_Private: typeof JWK_EC_Private;
|
|
124
|
+
declare const jws_JWK_EC_Public: typeof JWK_EC_Public;
|
|
125
|
+
declare const jws_JWK_HMAC: typeof JWK_HMAC;
|
|
126
|
+
declare const jws_JWK_OKP: typeof JWK_OKP;
|
|
127
|
+
declare const jws_JWK_OKP_Private: typeof JWK_OKP_Private;
|
|
128
|
+
declare const jws_JWK_OKP_Public: typeof JWK_OKP_Public;
|
|
129
|
+
declare const jws_JWK_OKP_SIGN: typeof JWK_OKP_SIGN;
|
|
130
|
+
declare const jws_JWK_PBES2: typeof JWK_PBES2;
|
|
131
|
+
declare const jws_JWK_Private: typeof JWK_Private;
|
|
132
|
+
declare const jws_JWK_Public: typeof JWK_Public;
|
|
133
|
+
declare const jws_JWK_RSA: typeof JWK_RSA;
|
|
134
|
+
declare const jws_JWK_RSA_ENC: typeof JWK_RSA_ENC;
|
|
135
|
+
declare const jws_JWK_RSA_PSS: typeof JWK_RSA_PSS;
|
|
136
|
+
declare const jws_JWK_RSA_Private: typeof JWK_RSA_Private;
|
|
137
|
+
declare const jws_JWK_RSA_Public: typeof JWK_RSA_Public;
|
|
138
|
+
declare const jws_JWK_RSA_SIGN: typeof JWK_RSA_SIGN;
|
|
139
|
+
declare const jws_JWK_Symmetric_Algorithm: typeof JWK_Symmetric_Algorithm;
|
|
140
|
+
declare const jws_JWK_oct: typeof JWK_oct;
|
|
103
141
|
type jws_JWSAlgorithm = JWSAlgorithm;
|
|
104
142
|
type jws_JWSHeaderParameters = JWSHeaderParameters;
|
|
105
143
|
type jws_JWSKeyLookupFunction = JWSKeyLookupFunction;
|
|
@@ -111,10 +149,14 @@ declare const jws_JWT: typeof JWT;
|
|
|
111
149
|
declare const jws_JWTClaimValidationOptions: typeof JWTClaimValidationOptions;
|
|
112
150
|
declare const jws_JWTClaims: typeof JWTClaims;
|
|
113
151
|
declare const jws_JoseHeaderParameters: typeof JoseHeaderParameters;
|
|
152
|
+
declare const jws_KeyManagementAlgorithm: typeof KeyManagementAlgorithm;
|
|
153
|
+
declare const jws_UnwrapKeyOptions: typeof UnwrapKeyOptions;
|
|
154
|
+
declare const jws_WrapKeyOptions: typeof WrapKeyOptions;
|
|
155
|
+
declare const jws_WrapKeyResult: typeof WrapKeyResult;
|
|
114
156
|
declare const jws_sign: typeof sign;
|
|
115
157
|
declare const jws_verify: typeof verify;
|
|
116
158
|
declare namespace jws {
|
|
117
|
-
export { jws_JWT as JWT, jws_JWTClaimValidationOptions as JWTClaimValidationOptions, jws_JWTClaims as JWTClaims, jws_JoseHeaderParameters as JoseHeaderParameters, jws_sign as sign, jws_verify as verify };
|
|
159
|
+
export { jws_CompositeKey as CompositeKey, jws_ContentEncryptionAlgorithm as ContentEncryptionAlgorithm, jws_DeriveKeyOptions as DeriveKeyOptions, jws_DeriveKeyReturn as DeriveKeyReturn, jws_GenerateKeyAlgorithm as GenerateKeyAlgorithm, jws_GenerateKeyOptions as GenerateKeyOptions, jws_GenerateKeyReturn as GenerateKeyReturn, jws_JWK as JWK, jws_JWKAlgorithm as JWKAlgorithm, jws_JWKPEMAlgorithm as JWKPEMAlgorithm, jws_JWKParameters as JWKParameters, jws_JWKSet as JWKSet, jws_JWK_AES_CBC_HMAC as JWK_AES_CBC_HMAC, jws_JWK_AES_GCM as JWK_AES_GCM, jws_JWK_AES_GCM_KW as JWK_AES_GCM_KW, jws_JWK_AES_KW as JWK_AES_KW, jws_JWK_Asymmetric_Algorithm as JWK_Asymmetric_Algorithm, jws_JWK_EC as JWK_EC, jws_JWK_ECDH_ES as JWK_ECDH_ES, jws_JWK_ECDSA as JWK_ECDSA, jws_JWK_EC_Private as JWK_EC_Private, jws_JWK_EC_Public as JWK_EC_Public, jws_JWK_HMAC as JWK_HMAC, jws_JWK_OKP as JWK_OKP, jws_JWK_OKP_Private as JWK_OKP_Private, jws_JWK_OKP_Public as JWK_OKP_Public, jws_JWK_OKP_SIGN as JWK_OKP_SIGN, jws_JWK_PBES2 as JWK_PBES2, jws_JWK_Private as JWK_Private, jws_JWK_Public as JWK_Public, jws_JWK_RSA as JWK_RSA, jws_JWK_RSA_ENC as JWK_RSA_ENC, jws_JWK_RSA_PSS as JWK_RSA_PSS, jws_JWK_RSA_Private as JWK_RSA_Private, jws_JWK_RSA_Public as JWK_RSA_Public, jws_JWK_RSA_SIGN as JWK_RSA_SIGN, jws_JWK_Symmetric_Algorithm as JWK_Symmetric_Algorithm, jws_JWK_oct as JWK_oct, jws_JWT as JWT, jws_JWTClaimValidationOptions as JWTClaimValidationOptions, jws_JWTClaims as JWTClaims, jws_JoseHeaderParameters as JoseHeaderParameters, jws_KeyManagementAlgorithm as KeyManagementAlgorithm, jws_UnwrapKeyOptions as UnwrapKeyOptions, jws_WrapKeyOptions as WrapKeyOptions, jws_WrapKeyResult as WrapKeyResult, jws_sign as sign, jws_verify as verify };
|
|
118
160
|
export type { jws_JWSAlgorithm as JWSAlgorithm, jws_JWSHeaderParameters as JWSHeaderParameters, jws_JWSKeyLookupFunction as JWSKeyLookupFunction, jws_JWSProtectedHeader as JWSProtectedHeader, jws_JWSSignOptions as JWSSignOptions, jws_JWSVerifyOptions as JWSVerifyOptions, jws_JWSVerifyResult as JWSVerifyResult };
|
|
119
161
|
}
|
|
120
162
|
|
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 computeJwtTimeClaims, 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, D as sanitizeObject, a as textDecoder, t as textEncoder, C as validateCriticalHeadersJWE, B as validateCriticalHeadersJWS, A as validateJwtClaims } from './shared/unjwt.
|
|
1
|
+
import './shared/unjwt.OzI0aGB_.mjs';
|
|
2
|
+
export { s as applyTypCtyDefaults, j as assertCryptoKey, d as base64Decode, b as base64Encode, e as base64UrlDecode, c as base64UrlEncode, z as computeJwtTimeClaims, 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, D as sanitizeObject, a as textDecoder, t as textEncoder, C as validateCriticalHeadersJWE, B as validateCriticalHeadersJWS, A as validateJwtClaims } from './shared/unjwt.DUVOOOvO.mjs';
|