jose 5.9.2 → 5.9.4
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 +12 -0
- package/dist/browser/jwks/remote.js +1 -1
- package/dist/browser/lib/jwt_claims_set.js +2 -1
- package/dist/browser/runtime/ecdhes.js +2 -1
- package/dist/browser/runtime/generate.js +1 -1
- package/dist/browser/util/errors.js +29 -64
- package/dist/node/cjs/jwks/remote.js +1 -1
- package/dist/node/cjs/lib/jwt_claims_set.js +2 -1
- package/dist/node/cjs/util/errors.js +34 -54
- package/dist/node/esm/jwks/remote.js +1 -1
- package/dist/node/esm/lib/jwt_claims_set.js +2 -1
- package/dist/node/esm/util/errors.js +34 -54
- package/dist/types/jwks/remote.d.ts +2 -2
- package/dist/types/jws/compact/verify.d.ts +1 -1
- package/dist/types/jws/flattened/verify.d.ts +1 -1
- package/dist/types/jws/general/verify.d.ts +1 -1
- package/dist/types/jwt/verify.d.ts +1 -1
- package/dist/types/key/export.d.ts +4 -4
- package/dist/types/key/generate_key_pair.d.ts +1 -2
- package/dist/types/key/generate_secret.d.ts +1 -2
- package/dist/types/key/import.d.ts +7 -8
- package/dist/types/types.d.ts +101 -84
- package/dist/types/util/base64url.d.ts +1 -1
- package/dist/types/util/errors.d.ts +39 -21
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JWK, KeyLike } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Exports a runtime-specific public key representation (KeyObject or CryptoKey) to
|
|
4
|
-
* SPKI string format.
|
|
3
|
+
* Exports a runtime-specific public key representation ({@link !KeyObject} or {@link !CryptoKey}) to
|
|
4
|
+
* a PEM-encoded SPKI string format.
|
|
5
5
|
*
|
|
6
6
|
* This function is exported (as a named export) from the main `'jose'` module entry point as well
|
|
7
7
|
* as from its subpath export `'jose/key/export'`.
|
|
@@ -10,8 +10,8 @@ import type { JWK, KeyLike } from '../types';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function exportSPKI(key: KeyLike): Promise<string>;
|
|
12
12
|
/**
|
|
13
|
-
* Exports a runtime-specific private key representation (KeyObject or CryptoKey) to
|
|
14
|
-
* PKCS8 string format.
|
|
13
|
+
* Exports a runtime-specific private key representation ({@link !KeyObject} or {@link !CryptoKey}) to
|
|
14
|
+
* a PEM-encoded PKCS8 string format.
|
|
15
15
|
*
|
|
16
16
|
* This function is exported (as a named export) from the main `'jose'` module entry point as well
|
|
17
17
|
* as from its subpath export `'jose/key/export'`.
|
|
@@ -18,8 +18,7 @@ export interface GenerateKeyPairOptions {
|
|
|
18
18
|
modulusLength?: number;
|
|
19
19
|
/**
|
|
20
20
|
* (Only effective in Web Crypto API runtimes) The value to use as
|
|
21
|
-
* {@link
|
|
22
|
-
* `extractable` argument. Default is false.
|
|
21
|
+
* {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false.
|
|
23
22
|
*
|
|
24
23
|
*/
|
|
25
24
|
extractable?: boolean;
|
|
@@ -2,8 +2,7 @@ import type { KeyLike } from '../types';
|
|
|
2
2
|
export interface GenerateSecretOptions {
|
|
3
3
|
/**
|
|
4
4
|
* (Only effective in Web Crypto API runtimes) The value to use as
|
|
5
|
-
* {@link
|
|
6
|
-
* `extractable` argument. Default is false.
|
|
5
|
+
* {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false.
|
|
7
6
|
*/
|
|
8
7
|
extractable?: boolean;
|
|
9
8
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { JWK, KeyLike } from '../types';
|
|
2
2
|
export interface PEMImportOptions {
|
|
3
3
|
/**
|
|
4
|
-
* (Only effective in Web Crypto API runtimes) The value to use as
|
|
5
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey SubtleCrypto.importKey()}
|
|
4
|
+
* (Only effective in Web Crypto API runtimes) The value to use as {@link !SubtleCrypto.importKey}
|
|
6
5
|
* `extractable` argument. Default is false.
|
|
7
6
|
*/
|
|
8
7
|
extractable?: boolean;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
|
-
* Imports a PEM-encoded SPKI string as a runtime-specific public key representation
|
|
12
|
-
* CryptoKey).
|
|
10
|
+
* Imports a PEM-encoded SPKI string as a runtime-specific public key representation
|
|
11
|
+
* ({@link !KeyObject} or {@link !CryptoKey}).
|
|
13
12
|
*
|
|
14
13
|
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
|
|
15
14
|
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
|
|
@@ -26,7 +25,7 @@ export interface PEMImportOptions {
|
|
|
26
25
|
export declare function importSPKI<KeyLikeType extends KeyLike = KeyLike>(spki: string, alg: string, options?: PEMImportOptions): Promise<KeyLikeType>;
|
|
27
26
|
/**
|
|
28
27
|
* Imports the SPKI from an X.509 string certificate as a runtime-specific public key representation
|
|
29
|
-
* (KeyObject or CryptoKey).
|
|
28
|
+
* ({@link !KeyObject} or {@link !CryptoKey}).
|
|
30
29
|
*
|
|
31
30
|
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
|
|
32
31
|
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
|
|
@@ -42,8 +41,8 @@ export declare function importSPKI<KeyLikeType extends KeyLike = KeyLike>(spki:
|
|
|
42
41
|
*/
|
|
43
42
|
export declare function importX509<KeyLikeType extends KeyLike = KeyLike>(x509: string, alg: string, options?: PEMImportOptions): Promise<KeyLikeType>;
|
|
44
43
|
/**
|
|
45
|
-
* Imports a PEM-encoded PKCS#8 string as a runtime-specific private key representation
|
|
46
|
-
* or CryptoKey).
|
|
44
|
+
* Imports a PEM-encoded PKCS#8 string as a runtime-specific private key representation
|
|
45
|
+
* ({@link !KeyObject} or {@link !CryptoKey}).
|
|
47
46
|
*
|
|
48
47
|
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
|
|
49
48
|
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
|
|
@@ -63,7 +62,7 @@ export declare function importPKCS8<KeyLikeType extends KeyLike = KeyLike>(pkcs8
|
|
|
63
62
|
* (Algorithm) Parameter, or the optional "alg" argument, must be present.
|
|
64
63
|
*
|
|
65
64
|
* Note: When the runtime is using {@link https://w3c.github.io/webcrypto/ Web Cryptography API} the
|
|
66
|
-
* jwk parameters "use", "key_ops", and "ext" are also used in the resulting
|
|
65
|
+
* jwk parameters "use", "key_ops", and "ext" are also used in the resulting {@link !CryptoKey}.
|
|
67
66
|
*
|
|
68
67
|
* This function is exported (as a named export) from the main `'jose'` module entry point as well
|
|
69
68
|
* as from its subpath export `'jose/key/import'`.
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,121 +1,122 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* KeyLike are runtime-specific classes representing asymmetric keys or symmetric secrets. These are
|
|
3
|
-
* instances of {@link
|
|
4
|
-
*
|
|
5
|
-
* runtime.
|
|
6
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array Uint8Array}
|
|
7
|
-
* instances are also accepted as symmetric secret representation only.
|
|
3
|
+
* instances of {@link !CryptoKey} and additionally {@link !KeyObject} in Node.js runtime.
|
|
4
|
+
* {@link !Uint8Array} instances are also accepted as symmetric secret representation only.
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* {@link key/import Key Import Functions} can be used to import PEM, or JWK formatted asymmetric
|
|
7
|
+
* keys and certificates to these runtime-specific representations.
|
|
11
8
|
*
|
|
12
|
-
* In Node.js the {@link
|
|
13
|
-
*
|
|
9
|
+
* In Node.js the {@link !Buffer} class is a subclass of {@link !Uint8Array} and so {@link !Buffer} can
|
|
10
|
+
* be provided for symmetric secrets as well.
|
|
14
11
|
*
|
|
15
|
-
* {@link
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* {@link
|
|
19
|
-
* {@link https://nodejs.org/api/crypto.html#cryptocreateprivatekeykey crypto.createPrivateKey}, and
|
|
20
|
-
* {@link https://nodejs.org/api/crypto.html#cryptocreatesecretkeykey-encoding crypto.createSecretKey}
|
|
21
|
-
* to obtain a `KeyObject` from your existing key material.
|
|
12
|
+
* {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. In
|
|
13
|
+
* addition to the {@link key/import Key Import Functions} you may use the runtime APIs
|
|
14
|
+
* {@link !createPublicKey}, {@link !createPrivateKey}, and {@link !createSecretKey} to obtain a
|
|
15
|
+
* {@link !KeyObject} from your existing key material.
|
|
22
16
|
*
|
|
23
|
-
* {@link
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* API to obtain a CryptoKey from your existing key material.
|
|
17
|
+
* {@link !CryptoKey} is a representation of a key/secret available in the Browser and
|
|
18
|
+
* Web-interoperable runtimes. In addition to the {@link key/import Key Import Functions} you may use
|
|
19
|
+
* the {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
|
|
20
|
+
* material.
|
|
28
21
|
*
|
|
29
22
|
*/
|
|
30
23
|
export type KeyLike = { type: string }
|
|
31
24
|
|
|
32
25
|
/** Generic JSON Web Key Parameters. */
|
|
33
26
|
export interface JWKParameters {
|
|
34
|
-
/** JWK "kty" (Key Type) Parameter
|
|
27
|
+
/** JWK "kty" (Key Type) Parameter */
|
|
35
28
|
kty: string
|
|
36
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* JWK "alg" (Algorithm) Parameter
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
|
|
33
|
+
*/
|
|
37
34
|
alg?: string
|
|
38
|
-
/** JWK "key_ops" (Key Operations) Parameter
|
|
35
|
+
/** JWK "key_ops" (Key Operations) Parameter */
|
|
39
36
|
key_ops?: string[]
|
|
40
|
-
/** JWK "ext" (Extractable) Parameter
|
|
37
|
+
/** JWK "ext" (Extractable) Parameter */
|
|
41
38
|
ext?: boolean
|
|
42
|
-
/** JWK "use" (Public Key Use) Parameter
|
|
39
|
+
/** JWK "use" (Public Key Use) Parameter */
|
|
43
40
|
use?: string
|
|
44
|
-
/** JWK "x5c" (X.509 Certificate Chain) Parameter
|
|
41
|
+
/** JWK "x5c" (X.509 Certificate Chain) Parameter */
|
|
45
42
|
x5c?: string[]
|
|
46
|
-
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter
|
|
43
|
+
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
|
|
47
44
|
x5t?: string
|
|
48
|
-
/** "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter
|
|
45
|
+
/** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
|
|
49
46
|
'x5t#S256'?: string
|
|
50
|
-
/** JWK "x5u" (X.509 URL) Parameter
|
|
47
|
+
/** JWK "x5u" (X.509 URL) Parameter */
|
|
51
48
|
x5u?: string
|
|
52
|
-
/** JWK "kid" (Key ID) Parameter
|
|
49
|
+
/** JWK "kid" (Key ID) Parameter */
|
|
53
50
|
kid?: string
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
/** Convenience interface for Public OKP JSON Web Keys */
|
|
57
54
|
export interface JWK_OKP_Public extends JWKParameters {
|
|
58
|
-
/** The Subtype of Key Pair */
|
|
55
|
+
/** OKP JWK "crv" (The Subtype of Key Pair) Parameter */
|
|
59
56
|
crv: string
|
|
60
|
-
/** The public key */
|
|
57
|
+
/** OKP JWK "x" (The public key) Parameter */
|
|
61
58
|
x: string
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
/** Convenience interface for Private OKP JSON Web Keys */
|
|
65
62
|
export interface JWK_OKP_Private extends JWK_OKP_Public, JWKParameters {
|
|
66
|
-
/** The Private Key */
|
|
63
|
+
/** OKP JWK "d" (The Private Key) Parameter */
|
|
67
64
|
d: string
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
/** Convenience interface for Public EC JSON Web Keys */
|
|
71
68
|
export interface JWK_EC_Public extends JWKParameters {
|
|
72
|
-
/** Curve */
|
|
69
|
+
/** EC JWK "crv" (Curve) Parameter */
|
|
73
70
|
crv: string
|
|
74
|
-
/** X Coordinate */
|
|
71
|
+
/** EC JWK "x" (X Coordinate) Parameter */
|
|
75
72
|
x: string
|
|
76
|
-
/** Y Coordinate */
|
|
73
|
+
/** EC JWK "y" (Y Coordinate) Parameter */
|
|
77
74
|
y: string
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
/** Convenience interface for Private EC JSON Web Keys */
|
|
81
78
|
export interface JWK_EC_Private extends JWK_EC_Public, JWKParameters {
|
|
82
|
-
/** ECC Private Key */
|
|
79
|
+
/** EC JWK "d" (ECC Private Key) Parameter */
|
|
83
80
|
d: string
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
/** Convenience interface for Public RSA JSON Web Keys */
|
|
87
84
|
export interface JWK_RSA_Public extends JWKParameters {
|
|
88
|
-
/** Exponent */
|
|
85
|
+
/** RSA JWK "e" (Exponent) Parameter */
|
|
89
86
|
e: string
|
|
90
|
-
/** Modulus */
|
|
87
|
+
/** RSA JWK "n" (Modulus) Parameter */
|
|
91
88
|
n: string
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
/** Convenience interface for Private RSA JSON Web Keys */
|
|
95
92
|
export interface JWK_RSA_Private extends JWK_RSA_Public, JWKParameters {
|
|
96
|
-
/** Private Exponent */
|
|
93
|
+
/** RSA JWK "d" (Private Exponent) Parameter */
|
|
97
94
|
d: string
|
|
98
|
-
/** First Factor CRT Exponent */
|
|
95
|
+
/** RSA JWK "dp" (First Factor CRT Exponent) Parameter */
|
|
99
96
|
dp: string
|
|
100
|
-
/** Second Factor CRT Exponent */
|
|
97
|
+
/** RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
|
|
101
98
|
dq: string
|
|
102
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* RSA JWK "oth" (Other Primes Info) Parameter
|
|
101
|
+
*
|
|
102
|
+
* This parameter is not supported
|
|
103
|
+
*/
|
|
103
104
|
oth?: Array<{
|
|
104
105
|
d?: string
|
|
105
106
|
r?: string
|
|
106
107
|
t?: string
|
|
107
108
|
}>
|
|
108
|
-
/** First Prime Factor */
|
|
109
|
+
/** RSA JWK "p" (First Prime Factor) Parameter */
|
|
109
110
|
p: string
|
|
110
|
-
/** Second Prime Factor */
|
|
111
|
+
/** RSA JWK "q" (Second Prime Factor) Parameter */
|
|
111
112
|
q: string
|
|
112
|
-
/** First CRT Coefficient */
|
|
113
|
+
/** RSA JWK "qi" (First CRT Coefficient) Parameter */
|
|
113
114
|
qi: string
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
/** Convenience interface for oct JSON Web Keys */
|
|
117
118
|
export interface JWK_oct extends JWKParameters {
|
|
118
|
-
/** Key Value */
|
|
119
|
+
/** Oct JWK "k" (Key Value) Parameter */
|
|
119
120
|
k: string
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -133,44 +134,48 @@ export interface JWK_oct extends JWKParameters {
|
|
|
133
134
|
*/
|
|
134
135
|
export interface JWK extends JWKParameters {
|
|
135
136
|
/**
|
|
136
|
-
* - (
|
|
137
|
-
* -
|
|
137
|
+
* - EC JWK "crv" (Curve) Parameter
|
|
138
|
+
* - OKP JWK "crv" (The Subtype of Key Pair) Parameter
|
|
138
139
|
*/
|
|
139
140
|
crv?: string
|
|
140
141
|
/**
|
|
141
|
-
* -
|
|
142
|
-
* -
|
|
143
|
-
* -
|
|
142
|
+
* - Private RSA JWK "d" (Private Exponent) Parameter
|
|
143
|
+
* - Private EC JWK "d" (ECC Private Key) Parameter
|
|
144
|
+
* - Private OKP JWK "d" (The Private Key) Parameter
|
|
144
145
|
*/
|
|
145
146
|
d?: string
|
|
146
|
-
/**
|
|
147
|
+
/** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
|
|
147
148
|
dp?: string
|
|
148
|
-
/**
|
|
149
|
+
/** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
|
|
149
150
|
dq?: string
|
|
150
|
-
/**
|
|
151
|
+
/** RSA JWK "e" (Exponent) Parameter */
|
|
151
152
|
e?: string
|
|
152
|
-
/** (
|
|
153
|
+
/** Oct JWK "k" (Key Value) Parameter */
|
|
153
154
|
k?: string
|
|
154
|
-
/**
|
|
155
|
+
/** RSA JWK "n" (Modulus) Parameter */
|
|
155
156
|
n?: string
|
|
156
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Private RSA JWK "oth" (Other Primes Info) Parameter
|
|
159
|
+
*
|
|
160
|
+
* This parameter is not supported
|
|
161
|
+
*/
|
|
157
162
|
oth?: Array<{
|
|
158
163
|
d?: string
|
|
159
164
|
r?: string
|
|
160
165
|
t?: string
|
|
161
166
|
}>
|
|
162
|
-
/**
|
|
167
|
+
/** Private RSA JWK "p" (First Prime Factor) Parameter */
|
|
163
168
|
p?: string
|
|
164
|
-
/**
|
|
169
|
+
/** Private RSA JWK "q" (Second Prime Factor) Parameter */
|
|
165
170
|
q?: string
|
|
166
|
-
/**
|
|
171
|
+
/** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
|
|
167
172
|
qi?: string
|
|
168
173
|
/**
|
|
169
|
-
* -
|
|
170
|
-
* -
|
|
174
|
+
* - EC JWK "x" (X Coordinate) Parameter
|
|
175
|
+
* - OKP JWK "x" (The public key) Parameter
|
|
171
176
|
*/
|
|
172
177
|
x?: string
|
|
173
|
-
/**
|
|
178
|
+
/** EC JWK "y" (Y Coordinate) Parameter */
|
|
174
179
|
y?: string
|
|
175
180
|
}
|
|
176
181
|
|
|
@@ -202,8 +207,8 @@ export interface GetKeyFunction<IProtectedHeader, IToken>
|
|
|
202
207
|
extends GenericGetKeyFunction<IProtectedHeader, IToken, KeyLike | Uint8Array> {}
|
|
203
208
|
|
|
204
209
|
/**
|
|
205
|
-
* Flattened JWS definition for verify function inputs, allows payload as Uint8Array for
|
|
206
|
-
* signature validation.
|
|
210
|
+
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
|
211
|
+
* detached signature validation.
|
|
207
212
|
*/
|
|
208
213
|
export interface FlattenedJWSInput {
|
|
209
214
|
/**
|
|
@@ -216,7 +221,7 @@ export interface FlattenedJWSInput {
|
|
|
216
221
|
|
|
217
222
|
/**
|
|
218
223
|
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When RFC7797
|
|
219
|
-
* "b64": false is used the value passed may also be a Uint8Array.
|
|
224
|
+
* "b64": false is used the value passed may also be a {@link !Uint8Array}.
|
|
220
225
|
*/
|
|
221
226
|
payload: string | Uint8Array
|
|
222
227
|
|
|
@@ -232,14 +237,14 @@ export interface FlattenedJWSInput {
|
|
|
232
237
|
}
|
|
233
238
|
|
|
234
239
|
/**
|
|
235
|
-
* General JWS definition for verify function inputs, allows payload as Uint8Array for
|
|
236
|
-
* signature validation.
|
|
240
|
+
* General JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
|
|
241
|
+
* detached signature validation.
|
|
237
242
|
*/
|
|
238
243
|
export interface GeneralJWSInput {
|
|
239
244
|
/**
|
|
240
245
|
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when
|
|
241
246
|
* JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) "b64": false is
|
|
242
|
-
* used the value passed may also be a Uint8Array.
|
|
247
|
+
* used the value passed may also be a {@link !Uint8Array}.
|
|
243
248
|
*/
|
|
244
249
|
payload: string | Uint8Array
|
|
245
250
|
|
|
@@ -269,34 +274,38 @@ export interface GeneralJWS {
|
|
|
269
274
|
}
|
|
270
275
|
|
|
271
276
|
export interface JoseHeaderParameters {
|
|
272
|
-
/** "kid" (Key ID) Header Parameter
|
|
277
|
+
/** "kid" (Key ID) Header Parameter */
|
|
273
278
|
kid?: string
|
|
274
279
|
|
|
275
|
-
/** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter
|
|
280
|
+
/** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
|
|
276
281
|
x5t?: string
|
|
277
282
|
|
|
278
|
-
/** "x5c" (X.509 Certificate Chain) Header Parameter
|
|
283
|
+
/** "x5c" (X.509 Certificate Chain) Header Parameter */
|
|
279
284
|
x5c?: string[]
|
|
280
285
|
|
|
281
|
-
/** "x5u" (X.509 URL) Header Parameter
|
|
286
|
+
/** "x5u" (X.509 URL) Header Parameter */
|
|
282
287
|
x5u?: string
|
|
283
288
|
|
|
284
|
-
/** "jku" (JWK Set URL) Header Parameter
|
|
289
|
+
/** "jku" (JWK Set URL) Header Parameter */
|
|
285
290
|
jku?: string
|
|
286
291
|
|
|
287
|
-
/** "jwk" (JSON Web Key) Header Parameter
|
|
292
|
+
/** "jwk" (JSON Web Key) Header Parameter */
|
|
288
293
|
jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n'>
|
|
289
294
|
|
|
290
|
-
/** "typ" (Type) Header Parameter
|
|
295
|
+
/** "typ" (Type) Header Parameter */
|
|
291
296
|
typ?: string
|
|
292
297
|
|
|
293
|
-
/** "cty" (Content Type) Header Parameter
|
|
298
|
+
/** "cty" (Content Type) Header Parameter */
|
|
294
299
|
cty?: string
|
|
295
300
|
}
|
|
296
301
|
|
|
297
302
|
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
|
|
298
303
|
export interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
299
|
-
/**
|
|
304
|
+
/**
|
|
305
|
+
* JWS "alg" (Algorithm) Header Parameter
|
|
306
|
+
*
|
|
307
|
+
* @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
|
|
308
|
+
*/
|
|
300
309
|
alg?: string
|
|
301
310
|
|
|
302
311
|
/**
|
|
@@ -305,7 +314,7 @@ export interface JWSHeaderParameters extends JoseHeaderParameters {
|
|
|
305
314
|
*/
|
|
306
315
|
b64?: boolean
|
|
307
316
|
|
|
308
|
-
/** JWS "crit" (Critical) Header Parameter
|
|
317
|
+
/** JWS "crit" (Critical) Header Parameter */
|
|
309
318
|
crit?: string[]
|
|
310
319
|
|
|
311
320
|
/** Any other JWS Header member. */
|
|
@@ -398,13 +407,21 @@ export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header
|
|
|
398
407
|
|
|
399
408
|
/** Recognized JWE Header Parameters, any other Header members may also be present. */
|
|
400
409
|
export interface JWEHeaderParameters extends JoseHeaderParameters {
|
|
401
|
-
/**
|
|
410
|
+
/**
|
|
411
|
+
* JWE "alg" (Algorithm) Header Parameter
|
|
412
|
+
*
|
|
413
|
+
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
|
|
414
|
+
*/
|
|
402
415
|
alg?: string
|
|
403
416
|
|
|
404
|
-
/**
|
|
417
|
+
/**
|
|
418
|
+
* JWE "enc" (Encryption Algorithm) Header Parameter
|
|
419
|
+
*
|
|
420
|
+
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
|
|
421
|
+
*/
|
|
405
422
|
enc?: string
|
|
406
423
|
|
|
407
|
-
/** JWE "crit" (Critical) Header Parameter
|
|
424
|
+
/** JWE "crit" (Critical) Header Parameter */
|
|
408
425
|
crit?: string[]
|
|
409
426
|
|
|
410
427
|
/**
|
|
@@ -9,11 +9,13 @@ export declare class JOSEError extends Error {
|
|
|
9
9
|
*
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
12
|
-
static
|
|
12
|
+
static code: string;
|
|
13
13
|
/** A unique error code for this particular error subclass. */
|
|
14
14
|
code: string;
|
|
15
15
|
/** @ignore */
|
|
16
|
-
constructor(message?: string
|
|
16
|
+
constructor(message?: string, options?: {
|
|
17
|
+
cause?: unknown;
|
|
18
|
+
});
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* An error subclass thrown when a JWT Claim Set member validation fails.
|
|
@@ -21,7 +23,7 @@ export declare class JOSEError extends Error {
|
|
|
21
23
|
*/
|
|
22
24
|
export declare class JWTClaimValidationFailed extends JOSEError {
|
|
23
25
|
/** @ignore */
|
|
24
|
-
static
|
|
26
|
+
static code: string;
|
|
25
27
|
code: string;
|
|
26
28
|
/** The Claim for which the validation failed. */
|
|
27
29
|
claim: string;
|
|
@@ -43,7 +45,7 @@ export declare class JWTClaimValidationFailed extends JOSEError {
|
|
|
43
45
|
*/
|
|
44
46
|
export declare class JWTExpired extends JOSEError implements JWTClaimValidationFailed {
|
|
45
47
|
/** @ignore */
|
|
46
|
-
static
|
|
48
|
+
static code: string;
|
|
47
49
|
code: string;
|
|
48
50
|
/** The Claim for which the validation failed. */
|
|
49
51
|
claim: string;
|
|
@@ -65,7 +67,7 @@ export declare class JWTExpired extends JOSEError implements JWTClaimValidationF
|
|
|
65
67
|
*/
|
|
66
68
|
export declare class JOSEAlgNotAllowed extends JOSEError {
|
|
67
69
|
/** @ignore */
|
|
68
|
-
static
|
|
70
|
+
static code: string;
|
|
69
71
|
code: string;
|
|
70
72
|
}
|
|
71
73
|
/**
|
|
@@ -75,7 +77,7 @@ export declare class JOSEAlgNotAllowed extends JOSEError {
|
|
|
75
77
|
*/
|
|
76
78
|
export declare class JOSENotSupported extends JOSEError {
|
|
77
79
|
/** @ignore */
|
|
78
|
-
static
|
|
80
|
+
static code: string;
|
|
79
81
|
code: string;
|
|
80
82
|
}
|
|
81
83
|
/**
|
|
@@ -84,9 +86,12 @@ export declare class JOSENotSupported extends JOSEError {
|
|
|
84
86
|
*/
|
|
85
87
|
export declare class JWEDecryptionFailed extends JOSEError {
|
|
86
88
|
/** @ignore */
|
|
87
|
-
static
|
|
89
|
+
static code: string;
|
|
88
90
|
code: string;
|
|
89
|
-
|
|
91
|
+
/** @ignore */
|
|
92
|
+
constructor(message?: string, options?: {
|
|
93
|
+
cause?: unknown;
|
|
94
|
+
});
|
|
90
95
|
}
|
|
91
96
|
/**
|
|
92
97
|
* An error subclass thrown when a JWE is invalid.
|
|
@@ -94,7 +99,7 @@ export declare class JWEDecryptionFailed extends JOSEError {
|
|
|
94
99
|
*/
|
|
95
100
|
export declare class JWEInvalid extends JOSEError {
|
|
96
101
|
/** @ignore */
|
|
97
|
-
static
|
|
102
|
+
static code: string;
|
|
98
103
|
code: string;
|
|
99
104
|
}
|
|
100
105
|
/**
|
|
@@ -103,7 +108,7 @@ export declare class JWEInvalid extends JOSEError {
|
|
|
103
108
|
*/
|
|
104
109
|
export declare class JWSInvalid extends JOSEError {
|
|
105
110
|
/** @ignore */
|
|
106
|
-
static
|
|
111
|
+
static code: string;
|
|
107
112
|
code: string;
|
|
108
113
|
}
|
|
109
114
|
/**
|
|
@@ -112,7 +117,7 @@ export declare class JWSInvalid extends JOSEError {
|
|
|
112
117
|
*/
|
|
113
118
|
export declare class JWTInvalid extends JOSEError {
|
|
114
119
|
/** @ignore */
|
|
115
|
-
static
|
|
120
|
+
static code: string;
|
|
116
121
|
code: string;
|
|
117
122
|
}
|
|
118
123
|
/**
|
|
@@ -121,7 +126,7 @@ export declare class JWTInvalid extends JOSEError {
|
|
|
121
126
|
*/
|
|
122
127
|
export declare class JWKInvalid extends JOSEError {
|
|
123
128
|
/** @ignore */
|
|
124
|
-
static
|
|
129
|
+
static code: string;
|
|
125
130
|
code: string;
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
@@ -130,7 +135,7 @@ export declare class JWKInvalid extends JOSEError {
|
|
|
130
135
|
*/
|
|
131
136
|
export declare class JWKSInvalid extends JOSEError {
|
|
132
137
|
/** @ignore */
|
|
133
|
-
static
|
|
138
|
+
static code: string;
|
|
134
139
|
code: string;
|
|
135
140
|
}
|
|
136
141
|
/**
|
|
@@ -139,9 +144,12 @@ export declare class JWKSInvalid extends JOSEError {
|
|
|
139
144
|
*/
|
|
140
145
|
export declare class JWKSNoMatchingKey extends JOSEError {
|
|
141
146
|
/** @ignore */
|
|
142
|
-
static
|
|
147
|
+
static code: string;
|
|
143
148
|
code: string;
|
|
144
|
-
|
|
149
|
+
/** @ignore */
|
|
150
|
+
constructor(message?: string, options?: {
|
|
151
|
+
cause?: unknown;
|
|
152
|
+
});
|
|
145
153
|
}
|
|
146
154
|
/**
|
|
147
155
|
* An error subclass thrown when multiple keys match from a JWKS.
|
|
@@ -150,9 +158,13 @@ export declare class JWKSNoMatchingKey extends JOSEError {
|
|
|
150
158
|
export declare class JWKSMultipleMatchingKeys extends JOSEError {
|
|
151
159
|
/** @ignore */
|
|
152
160
|
[Symbol.asyncIterator]: () => AsyncIterableIterator<KeyLike>;
|
|
153
|
-
|
|
161
|
+
/** @ignore */
|
|
162
|
+
static code: string;
|
|
154
163
|
code: string;
|
|
155
|
-
|
|
164
|
+
/** @ignore */
|
|
165
|
+
constructor(message?: string, options?: {
|
|
166
|
+
cause?: unknown;
|
|
167
|
+
});
|
|
156
168
|
}
|
|
157
169
|
/**
|
|
158
170
|
* Timeout was reached when retrieving the JWKS response.
|
|
@@ -160,9 +172,12 @@ export declare class JWKSMultipleMatchingKeys extends JOSEError {
|
|
|
160
172
|
*/
|
|
161
173
|
export declare class JWKSTimeout extends JOSEError {
|
|
162
174
|
/** @ignore */
|
|
163
|
-
static
|
|
175
|
+
static code: string;
|
|
164
176
|
code: string;
|
|
165
|
-
|
|
177
|
+
/** @ignore */
|
|
178
|
+
constructor(message?: string, options?: {
|
|
179
|
+
cause?: unknown;
|
|
180
|
+
});
|
|
166
181
|
}
|
|
167
182
|
/**
|
|
168
183
|
* An error subclass thrown when JWS signature verification fails.
|
|
@@ -170,7 +185,10 @@ export declare class JWKSTimeout extends JOSEError {
|
|
|
170
185
|
*/
|
|
171
186
|
export declare class JWSSignatureVerificationFailed extends JOSEError {
|
|
172
187
|
/** @ignore */
|
|
173
|
-
static
|
|
188
|
+
static code: string;
|
|
174
189
|
code: string;
|
|
175
|
-
|
|
190
|
+
/** @ignore */
|
|
191
|
+
constructor(message?: string, options?: {
|
|
192
|
+
cause?: unknown;
|
|
193
|
+
});
|
|
176
194
|
}
|