jose 5.9.2 → 5.9.3

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.
@@ -10,7 +10,7 @@ function isCloudflareWorkers() {
10
10
  let USER_AGENT;
11
11
  if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
12
12
  const NAME = 'jose';
13
- const VERSION = 'v5.9.2';
13
+ const VERSION = 'v5.9.3';
14
14
  USER_AGENT = `${NAME}/${VERSION}`;
15
15
  }
16
16
  export const jwksCache = Symbol();
@@ -44,7 +44,8 @@ export default (protectedHeader, encodedPayload, options = {}) => {
44
44
  throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing');
45
45
  }
46
46
  }
47
- if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
47
+ if (issuer &&
48
+ !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
48
49
  throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed');
49
50
  }
50
51
  if (subject && payload.sub !== subject) {
@@ -22,7 +22,8 @@ export async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu
22
22
  }
23
23
  else {
24
24
  length =
25
- Math.ceil(parseInt(publicKey.algorithm.namedCurve.substr(-3), 10) / 8) << 3;
25
+ Math.ceil(parseInt(publicKey.algorithm.namedCurve.substr(-3), 10) / 8) <<
26
+ 3;
26
27
  }
27
28
  const sharedSecret = new Uint8Array(await crypto.subtle.deriveBits({
28
29
  name: publicKey.algorithm.name,
@@ -135,5 +135,5 @@ export async function generateKeyPair(alg, options) {
135
135
  default:
136
136
  throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
137
137
  }
138
- return (crypto.subtle.generateKey(algorithm, options?.extractable ?? false, keyUsages));
138
+ return crypto.subtle.generateKey(algorithm, options?.extractable ?? false, keyUsages);
139
139
  }
@@ -13,7 +13,7 @@ function isCloudflareWorkers() {
13
13
  let USER_AGENT;
14
14
  if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
15
15
  const NAME = 'jose';
16
- const VERSION = 'v5.9.2';
16
+ const VERSION = 'v5.9.3';
17
17
  USER_AGENT = `${NAME}/${VERSION}`;
18
18
  }
19
19
  exports.jwksCache = Symbol();
@@ -46,7 +46,8 @@ exports.default = (protectedHeader, encodedPayload, options = {}) => {
46
46
  throw new errors_js_1.JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing');
47
47
  }
48
48
  }
49
- if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
49
+ if (issuer &&
50
+ !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
50
51
  throw new errors_js_1.JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed');
51
52
  }
52
53
  if (subject && payload.sub !== subject) {
@@ -10,7 +10,7 @@ function isCloudflareWorkers() {
10
10
  let USER_AGENT;
11
11
  if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
12
12
  const NAME = 'jose';
13
- const VERSION = 'v5.9.2';
13
+ const VERSION = 'v5.9.3';
14
14
  USER_AGENT = `${NAME}/${VERSION}`;
15
15
  }
16
16
  export const jwksCache = Symbol();
@@ -44,7 +44,8 @@ export default (protectedHeader, encodedPayload, options = {}) => {
44
44
  throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, 'missing');
45
45
  }
46
46
  }
47
- if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
47
+ if (issuer &&
48
+ !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
48
49
  throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, 'iss', 'check_failed');
49
50
  }
50
51
  if (subject && payload.sub !== subject) {
@@ -3,7 +3,7 @@ import type { JWK, CompactVerifyResult, FlattenedJWSInput, GenericGetKeyFunction
3
3
  * Interface for Compact JWS Verification dynamic key resolution. No token components have been
4
4
  * verified at the time of this function call.
5
5
  *
6
- * @see [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset) to verify using a remote JSON Web Key Set.
6
+ * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
7
7
  */
8
8
  export interface CompactVerifyGetKey extends GenericGetKeyFunction<CompactJWSHeaderParameters, FlattenedJWSInput, KeyLike | JWK | Uint8Array> {
9
9
  }
@@ -3,7 +3,7 @@ import type { JWK, FlattenedVerifyResult, KeyLike, FlattenedJWSInput, JWSHeaderP
3
3
  * Interface for Flattened JWS Verification dynamic key resolution. No token components have been
4
4
  * verified at the time of this function call.
5
5
  *
6
- * @see [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset) to verify using a remote JSON Web Key Set.
6
+ * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
7
7
  */
8
8
  export interface FlattenedVerifyGetKey extends GenericGetKeyFunction<JWSHeaderParameters | undefined, FlattenedJWSInput, KeyLike | JWK | Uint8Array> {
9
9
  }
@@ -3,7 +3,7 @@ import type { JWK, GeneralJWSInput, GeneralVerifyResult, FlattenedJWSInput, Gene
3
3
  * Interface for General JWS Verification dynamic key resolution. No token components have been
4
4
  * verified at the time of this function call.
5
5
  *
6
- * @see [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset) to verify using a remote JSON Web Key Set.
6
+ * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
7
7
  */
8
8
  export interface GeneralVerifyGetKey extends GenericGetKeyFunction<JWSHeaderParameters, FlattenedJWSInput, KeyLike | JWK | Uint8Array> {
9
9
  }
@@ -6,7 +6,7 @@ export interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOpt
6
6
  * Interface for JWT Verification dynamic key resolution. No token components have been verified at
7
7
  * the time of this function call.
8
8
  *
9
- * @see [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset) to verify using a remote JSON Web Key Set.
9
+ * @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
10
10
  */
11
11
  export interface JWTVerifyGetKey extends GenericGetKeyFunction<JWTHeaderParameters, FlattenedJWSInput, KeyLike | JWK | Uint8Array> {
12
12
  }
@@ -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 a PEM-encoded
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 a PEM-encoded
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 https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey SubtleCrypto.generateKey()}
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 https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey SubtleCrypto.generateKey()}
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 (KeyObject or
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 (KeyObject
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 `CryptoKey`.
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'`.
@@ -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 https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey CryptoKey} and
4
- * additionally {@link https://nodejs.org/api/crypto.html#class-keyobject KeyObject} in Node.js
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
- * [Key Import Functions](../modules/key_import.md) can be used to import PEM, or JWK formatted
10
- * asymmetric keys and certificates to these runtime-specific representations.
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 https://nodejs.org/api/buffer.html#buffer Buffer} class is a subclass of
13
- * Uint8Array and so Buffer can be provided for symmetric secrets as well.
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 https://nodejs.org/api/crypto.html#class-keyobject KeyObject} is a representation of a
16
- * key/secret available in the Node.js runtime. In addition to the import functions of this library
17
- * you may use the runtime APIs
18
- * {@link https://nodejs.org/api/crypto.html#cryptocreatepublickeykey crypto.createPublicKey},
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 https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey CryptoKey} is a representation
24
- * of a key/secret available in the Browser and Web-interoperable runtimes. In addition to the
25
- * import functions of this library you may use the
26
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey SubtleCrypto.importKey}
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
- /** JWK "alg" (Algorithm) Parameter. */
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
- /** Other Primes Info. This parameter is not supported. */
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
- * - (EC) Curve
137
- * - (OKP) The Subtype of Key Pair
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
- * - (Private RSA) Private Exponent
142
- * - (Private EC) ECC Private Key
143
- * - (Private OKP) The Private Key
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
- /** (Private RSA) First Factor CRT Exponent */
147
+ /** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
147
148
  dp?: string
148
- /** (Private RSA) Second Factor CRT Exponent */
149
+ /** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
149
150
  dq?: string
150
- /** (RSA) Exponent */
151
+ /** RSA JWK "e" (Exponent) Parameter */
151
152
  e?: string
152
- /** (oct) Key Value */
153
+ /** Oct JWK "k" (Key Value) Parameter */
153
154
  k?: string
154
- /** (RSA) Modulus */
155
+ /** RSA JWK "n" (Modulus) Parameter */
155
156
  n?: string
156
- /** (Private RSA) Other Primes Info. This parameter is not supported. */
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
- /** (Private RSA) First Prime Factor */
167
+ /** Private RSA JWK "p" (First Prime Factor) Parameter */
163
168
  p?: string
164
- /** (Private RSA) Second Prime Factor */
169
+ /** Private RSA JWK "q" (Second Prime Factor) Parameter */
165
170
  q?: string
166
- /** (Private RSA) First CRT Coefficient */
171
+ /** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
167
172
  qi?: string
168
173
  /**
169
- * - (EC) X Coordinate
170
- * - (OKP) The public key
174
+ * - EC JWK "x" (X Coordinate) Parameter
175
+ * - OKP JWK "x" (The public key) Parameter
171
176
  */
172
177
  x?: string
173
- /** (EC) Y Coordinate */
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 detached
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 detached
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
- /** JWS "alg" (Algorithm) Header Parameter. */
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
- /** JWE "alg" (Algorithm) Header Parameter. */
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
- /** JWE "enc" (Encryption Algorithm) Header Parameter. */
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
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Utility function to encode a string or Uint8Array as a base64url string.
2
+ * Utility function to encode a string or {@link !Uint8Array} as a base64url string.
3
3
  *
4
4
  * @param input Value that will be base64url-encoded.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "5.9.2",
3
+ "version": "5.9.3",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "browser",