unjwt 0.5.38 → 0.5.39
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 +142 -666
- package/dist/_chunks/chunk.mjs +13 -0
- package/dist/_chunks/h3v1.mjs +598 -0
- package/dist/_chunks/index.d.mts +250 -0
- package/dist/_chunks/index2.d.mts +108 -0
- package/dist/_chunks/jwe.d.mts +43 -0
- package/dist/_chunks/jwe.mjs +132 -0
- package/dist/_chunks/jwk.d.mts +575 -0
- package/dist/_chunks/jwk.mjs +1592 -0
- package/dist/_chunks/jws.d.mts +46 -0
- package/dist/_chunks/jws.mjs +2069 -0
- package/dist/_chunks/utils.mjs +374 -0
- package/dist/adapters/h3.d.mts +3 -267
- package/dist/adapters/h3.mjs +3 -704
- package/dist/adapters/h3v1.d.mts +3 -8
- package/dist/adapters/h3v1.mjs +3 -7
- package/dist/adapters/h3v2.d.mts +145 -146
- package/dist/adapters/h3v2.mjs +505 -594
- package/dist/index.d.mts +6 -8
- package/dist/index.mjs +5 -4
- package/dist/jwe.d.mts +3 -4
- package/dist/jwe.mjs +4 -3
- package/dist/jwk.d.mts +3 -2
- package/dist/jwk.mjs +3 -2
- package/dist/jws.d.mts +3 -3
- package/dist/jws.mjs +4 -3
- package/dist/utils.d.mts +3 -3
- package/dist/utils.mjs +2 -1
- package/package.json +33 -31
- package/dist/shared/unjwt.4JQCoID_.d.mts +0 -161
- package/dist/shared/unjwt.B-v62plj.mjs +0 -249
- package/dist/shared/unjwt.BCi3FEWr.d.mts +0 -328
- package/dist/shared/unjwt.BYDTEWa-.d.mts +0 -269
- package/dist/shared/unjwt.Be8NxwFK.mjs +0 -438
- package/dist/shared/unjwt.BqdNUKDr.d.mts +0 -64
- package/dist/shared/unjwt.CMNtw8ek.d.mts +0 -155
- package/dist/shared/unjwt.Cy2MlkUe.d.mts +0 -174
- package/dist/shared/unjwt.D0_ccT7g.d.mts +0 -166
- package/dist/shared/unjwt.DdLN9vwI.mjs +0 -163
- package/dist/shared/unjwt.Dpl__ZAR.mjs +0 -2121
- package/dist/shared/unjwt.JdKqVANs.d.mts +0 -5
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { $ as JWK_Public, A as JWK, B as JWK_Asymmetric_Algorithm, C as DeriveKeyOptions, D as GenerateKeyAlgorithm, E as GenerateJWKReturn, F as JWK_AES_CBC_HMAC, G as JWK_EC_Public, H as JWK_ECDH_ES, I as JWK_AES_GCM, J as JWK_OKP_Private, K as JWK_HMAC, L as JWK_AES_GCM_KW, M as JWKPEMAlgorithm, N as JWKParameters, O as GenerateKeyOptions, P as JWKSet, Q as JWK_Private, R as JWK_AES_KW, S as ContentEncryptionAlgorithm, T as GenerateJWKOptions, U as JWK_ECDSA, V as JWK_EC, W as JWK_EC_Private, X as JWK_OKP_SIGN, Y as JWK_OKP_Public, Z as JWK_PBES2, _ as JWT, at as JWK_RSA_SIGN, b as JoseHeaderParameters, ct as JWK_oct, d as JWSHeaderParameters, dt as WrapKeyOptions, et as JWK_RSA, f as JWSKeyLookupFunction, ft as WrapKeyResult, g as JWSVerifyResult, h as JWSVerifyOptions, it as JWK_RSA_Public, j as JWKAlgorithm, k as GenerateKeyReturn, lt as KeyManagementAlgorithm, m as JWSSignOptions, nt as JWK_RSA_PSS, ot as JWK_Symmetric, p as JWSProtectedHeader, q as JWK_OKP, rt as JWK_RSA_Private, st as JWK_Symmetric_Algorithm, tt as JWK_RSA_ENC, u as JWSAlgorithm, ut as UnwrapKeyOptions, v as JWTClaimValidationOptions, w as DeriveKeyReturn, x as CompositeKey, y as JWTClaims, z as JWK_Asymmetric } from "./index.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/jws.d.ts
|
|
4
|
+
declare namespace jws_d_exports {
|
|
5
|
+
export { CompositeKey, ContentEncryptionAlgorithm, DeriveKeyOptions, DeriveKeyReturn, GenerateJWKOptions, GenerateJWKReturn, GenerateKeyAlgorithm, GenerateKeyOptions, GenerateKeyReturn, JWK, JWKAlgorithm, 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_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, JWSHeaderParameters, JWSKeyLookupFunction, JWSProtectedHeader, JWSSignOptions, JWSVerifyOptions, JWSVerifyResult, JWT, JWTClaimValidationOptions, JWTClaims, JoseHeaderParameters, KeyManagementAlgorithm, UnwrapKeyOptions, WrapKeyOptions, WrapKeyResult, sign, verify };
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Creates a JWS (JSON Web Signature) in Compact Serialization format.
|
|
9
|
+
*
|
|
10
|
+
* @param payload The payload to sign. Can be a string, Uint8Array, or an object (which will be JSON stringified).
|
|
11
|
+
* @param key The signing key (CryptoKey, JWK, or raw symmetric key as Uint8Array).
|
|
12
|
+
* @param options Signing options, including the algorithm (`alg`) and protected header parameters.
|
|
13
|
+
* @returns A Promise resolving to the JWS Compact Serialization string.
|
|
14
|
+
*/
|
|
15
|
+
declare function sign(payload: JWTClaims, key: JWK_Symmetric | JWK_Private, options?: JWSSignOptions): Promise<string>;
|
|
16
|
+
declare function sign(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: JWK_Symmetric | JWK_Private, options?: JWSSignOptions): Promise<string>;
|
|
17
|
+
declare function sign(payload: JWTClaims, key: CryptoKey, options: JWSSignOptions & {
|
|
18
|
+
alg: JWSAlgorithm;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
declare function sign(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey, options: JWSSignOptions & {
|
|
21
|
+
alg: JWSAlgorithm;
|
|
22
|
+
}): Promise<string>;
|
|
23
|
+
declare function sign(payload: JWTClaims, key: Uint8Array<ArrayBuffer>, options: JWSSignOptions & {
|
|
24
|
+
alg: JWSAlgorithm;
|
|
25
|
+
}): Promise<string>;
|
|
26
|
+
declare function sign(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: Uint8Array<ArrayBuffer>, options: JWSSignOptions & {
|
|
27
|
+
alg: JWSAlgorithm;
|
|
28
|
+
}): Promise<string>;
|
|
29
|
+
declare function sign(payload: string | Uint8Array<ArrayBuffer> | Record<string, any>, key: CryptoKey | JWK_Symmetric | JWK_Private | Uint8Array<ArrayBuffer>, options: JWSSignOptions & {
|
|
30
|
+
alg: JWSAlgorithm;
|
|
31
|
+
}): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Verifies a JWS (JSON Web Signature) in Compact Serialization format.
|
|
34
|
+
*
|
|
35
|
+
* @param jws The JWS Compact Serialization string.
|
|
36
|
+
* @param key The verification key (CryptoKey, JWK, JWKSet, raw symmetric key as Uint8Array, or a function resolving the key or set).
|
|
37
|
+
* @param options Verification options, such as allowed algorithms.
|
|
38
|
+
* @returns A Promise resolving to an object containing the verified payload and protected header.
|
|
39
|
+
* @throws If the JWS is invalid, signature verification fails, or options are not met.
|
|
40
|
+
*/
|
|
41
|
+
declare function verify<T extends JWTClaims | Uint8Array<ArrayBuffer> | string>(jws: string, key: CryptoKey | JWK_Symmetric | JWK_Public | JWKSet | Uint8Array<ArrayBuffer> | JWSKeyLookupFunction, options?: JWSVerifyOptions): Promise<JWSVerifyResult<T>>;
|
|
42
|
+
declare function verify(jws: string, key: CryptoKey | JWK_Symmetric | JWK_Public | JWKSet | Uint8Array<ArrayBuffer> | JWSKeyLookupFunction, options: JWSVerifyOptions & {
|
|
43
|
+
forceUint8Array: true;
|
|
44
|
+
}): Promise<JWSVerifyResult<Uint8Array<ArrayBuffer>>>;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { sign as n, verify as r, jws_d_exports as t };
|