jose 2.0.5 → 2.0.7

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.
@@ -52,7 +52,7 @@ const validateAlgorithms = (algorithms, option) => {
52
52
  /*
53
53
  * @public
54
54
  */
55
- const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, keyManagementAlgorithms, contentEncryptionAlgorithms } = {}) => {
55
+ const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, keyManagementAlgorithms, contentEncryptionAlgorithms, maxPBES2Count = 10000, inflateRawSyncLimit = 250000 } = {}) => {
56
56
  key = getKey(key, true)
57
57
 
58
58
  keyManagementAlgorithms = validateAlgorithms(keyManagementAlgorithms, 'keyManagementAlgorithms')
@@ -142,6 +142,12 @@ const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], c
142
142
 
143
143
  check(key, ...(alg === 'dir' ? ['decrypt', enc] : ['keyManagementDecrypt', alg]))
144
144
 
145
+ if (alg.startsWith('PBES2')) {
146
+ if (opts && opts.p2c > maxPBES2Count) {
147
+ throw new errors.JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds')
148
+ }
149
+ }
150
+
145
151
  try {
146
152
  if (alg === 'dir') {
147
153
  cek = JWK.asKey(key, { alg: enc, use: 'enc' })
@@ -183,7 +189,7 @@ const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], c
183
189
  let cleartext = decrypt(enc, cek, base64url.decodeToBuffer(ciphertext), { iv, tag, aad: adata })
184
190
 
185
191
  if (opts.zip) {
186
- cleartext = inflateRawSync(cleartext)
192
+ cleartext = inflateRawSync(cleartext, { maxOutputLength: inflateRawSyncLimit })
187
193
  }
188
194
 
189
195
  if (complete) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies",
5
5
  "keywords": [
6
6
  "access token",
package/types/index.d.ts CHANGED
@@ -401,6 +401,8 @@ export namespace JWE {
401
401
  crit?: string[];
402
402
  contentEncryptionAlgorithms?: string[];
403
403
  keyManagementAlgorithms?: string[];
404
+ maxPBES2Count?: number;
405
+ inflateRawSyncLimit?: number;
404
406
  }
405
407
 
406
408
  interface completeDecrypt {
package/CHANGELOG.md DELETED
@@ -1,840 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ## [2.0.5](https://github.com/panva/jose/compare/v2.0.4...v2.0.5) (2021-04-09)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * defer AES CBC w/ HMAC decryption after tag verification passes ([812e03f](https://github.com/panva/jose/commit/812e03fcf4963791ffd9a46417beea5a7a74d995))
11
-
12
- ## [2.0.4](https://github.com/panva/jose/compare/v2.0.3...v2.0.4) (2021-01-18)
13
-
14
-
15
- ### Performance
16
-
17
- * improve base64url encoding when available in Node.js ([d5af559](https://github.com/panva/jose/commit/d5af559a94f51ee82951e1def5c5c5749dfa290a))
18
-
19
- ## [2.0.3](https://github.com/panva/jose/compare/v2.0.2...v2.0.3) (2020-10-29)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * allow stubbing of the JWT.decode function ([6c3b92f](https://github.com/panva/jose/commit/6c3b92f4394a5d7092d7336922eda61e311e6f8c))
25
-
26
- ## [2.0.2](https://github.com/panva/jose/compare/v2.0.1...v2.0.2) (2020-09-14)
27
-
28
-
29
- ### Bug Fixes
30
-
31
- * **esm:** include esm files in the published package ([1956746](https://github.com/panva/jose/commit/1956746df6542c00bc33af750f93394805b5d603))
32
-
33
- ## [2.0.1](https://github.com/panva/jose/compare/v2.0.0...v2.0.1) (2020-09-10)
34
-
35
-
36
- ### Bug Fixes
37
-
38
- * allow plugins such as jose-chacha to work in newer node runtime ([30f1dc2](https://github.com/panva/jose/commit/30f1dc2c41e5554d322167b84b610a99bf5e69c5))
39
-
40
- ## [2.0.0](https://github.com/panva/jose/compare/v1.28.0...v2.0.0) (2020-09-08)
41
-
42
-
43
- ### ⚠ BREAKING CHANGES
44
-
45
- * the `JWE.decrypt` option `algorithms` was removed and
46
- replaced with contentEncryptionAlgorithms (handles `enc` allowlist) and
47
- keyManagementAlgorithms (handles `alg` allowlist)
48
- * the `JWT.verify` profile option was removed, use e.g.
49
- `JWT.IdToken.verify` instead.
50
- * removed the `maxAuthAge` `JWT.verify` option, this
51
- option is now only present at the specific JWT profile APIs where the
52
- `auth_time` property applies.
53
- * removed the `nonce` `JWT.verify` option, this
54
- option is now only present at the specific JWT profile APIs where the
55
- `nonce` property applies.
56
- * the `acr`, `amr`, `nonce` and `azp` claim value types
57
- will only be checked when verifying a specific JWT profile using its
58
- dedicated API.
59
- * using the draft implementing APIs will emit a one-time
60
- warning per process using `process.emitWarning`
61
- * `JWT.sign` function options no longer accept a `nonce`
62
- property. To create a JWT with a `nonce` just pass the value to the
63
- payload.
64
- * due to added ESM module support Node.js version with
65
- ESM implementation bugs are no longer supported, this only affects early
66
- v13.x versions. The resulting Node.js semver range is
67
- `>=10.13.0 < 13 || >=13.7.0`
68
- * deprecated method `JWK.importKey` was removed
69
- * deprecated method `JWKS.KeyStore.fromJWKS` was removed
70
- * the use of unregistered curve name P-256K for secp256k1
71
- was removed
72
- * jose.JWE.Encrypt constructor aad and unprotectedHeader
73
- arguments swapped places
74
- * jose.JWE.encrypt.flattened header (unprotectedHeader)
75
- and aad arguments swapped places
76
- * jose.JWE.encrypt.general header (unprotectedHeader)
77
- and aad arguments swapped places
78
- * JWS.verify returned payloads are now always buffers
79
- * JWS.verify options `encoding` and `parse` were removed
80
-
81
- ### Features
82
-
83
- * added support for ESM (ECMAScript modules) ([1aa9035](https://github.com/panva/jose/commit/1aa9035552bbcb34b95e092d0f082cc6d94465ab))
84
- * decrypt allowlists for both key management and content encryption ([30e5c46](https://github.com/panva/jose/commit/30e5c46ecf00a498e65a551ced88bc897531c2a4))
85
-
86
-
87
- ### Bug Fixes
88
-
89
- * **typescript:** allow Buffer when verifying detached signature ([cadbd04](https://github.com/panva/jose/commit/cadbd047ca953d6d8171439f2efd7bb98a5d8e73))
90
- * **typescript:** properly type all decode/verify/decrypt fn options ([4c23bd6](https://github.com/panva/jose/commit/4c23bd65fe6fa634726a5eb73c6d590f7348a97e))
91
-
92
-
93
- ### Refactor
94
-
95
- * encrypt APIs unprotectedHeader and aad arguments swapped ([70bd4ae](https://github.com/panva/jose/commit/70bd4ae6b2e6ba94bbe0b3dc1a17b2990af3a18b))
96
- * move JWT profile specifics outside of generic JWT ([fd69d7f](https://github.com/panva/jose/commit/fd69d7f5093d0b3a231d7d79aa3bca3a8a64464c))
97
- * removed `nonce` option from `JWT.sign` ([c4267cc](https://github.com/panva/jose/commit/c4267cc655bc2721d846c98f8a40640d1a12e9ad))
98
- * removed deprecated methods and utilities ([6c35c51](https://github.com/panva/jose/commit/6c35c519c9181f8246b36ad02572adb609d6de1d))
99
- * removed payload parsing from JWS.verify ([ba5c897](https://github.com/panva/jose/commit/ba5c89791915a2a3cd56b3dab1f3328778152d33))
100
-
101
- ## [1.28.0](https://github.com/panva/jose/compare/v1.27.3...v1.28.0) (2020-08-10)
102
-
103
-
104
- ### Features
105
-
106
- * support for validating issuer from a list of values ([#91](https://github.com/panva/jose/issues/91)) ([ce6836a](https://github.com/panva/jose/commit/ce6836af88c9e73c29560233f15ed1760c7dcc13))
107
-
108
-
109
-
110
- ## [1.27.3](https://github.com/panva/jose/compare/v1.27.2...v1.27.3) (2020-08-04)
111
-
112
-
113
- ### Bug Fixes
114
-
115
- * do not mutate unencoded payload when signing for multiple parties ([1695423](https://github.com/panva/jose/commit/169542363f884e4028db9f80086d631e626eb469)), closes [#89](https://github.com/panva/jose/issues/89)
116
- * ensure "b64" is the same for all recipients edge cases ([d56ec9f](https://github.com/panva/jose/commit/d56ec9f5ddc2612e5ff21fe35d45a56e7153e0e4))
117
-
118
-
119
-
120
- ## [1.27.2](https://github.com/panva/jose/compare/v1.27.1...v1.27.2) (2020-07-01)
121
-
122
-
123
- ### Bug Fixes
124
-
125
- * handle private EC keys without public component ([#86](https://github.com/panva/jose/issues/86)) ([e8ad389](https://github.com/panva/jose/commit/e8ad38993e29747098f7fd1594dde4ce893ba802)), closes [#85](https://github.com/panva/jose/issues/85)
126
-
127
-
128
-
129
- ## [1.27.1](https://github.com/panva/jose/compare/v1.27.0...v1.27.1) (2020-06-01)
130
-
131
-
132
- ### Bug Fixes
133
-
134
- * allow any JSON numeric value for timestamp values ([7ba4922](https://github.com/panva/jose/commit/7ba492237aaf788914166c134d50fb046041efa0))
135
-
136
-
137
-
138
- ## [1.27.0](https://github.com/panva/jose/compare/v1.26.1...v1.27.0) (2020-05-05)
139
-
140
-
141
- ### Features
142
-
143
- * add opt-in objects to verify using embedded JWS Header public keys ([7c1cab1](https://github.com/panva/jose/commit/7c1cab196edc409ec6cc4741bdf7e06c5aaf5dab))
144
-
145
-
146
-
147
- ## [1.26.1](https://github.com/panva/jose/compare/v1.26.0...v1.26.1) (2020-04-27)
148
-
149
-
150
- ### Bug Fixes
151
-
152
- * **typescript:** types of key generate functions without overloads ([7e60722](https://github.com/panva/jose/commit/7e60722ae7054f8acf833e015c22679d56fbc0ca)), closes [#80](https://github.com/panva/jose/issues/80)
153
- * "typ" content-type validation, case insensitive and handled prefix ([0691586](https://github.com/panva/jose/commit/06915861b32c0ae252dcc84791050bc3716ce102))
154
-
155
-
156
-
157
- ## [1.26.0](https://github.com/panva/jose/compare/v1.25.2...v1.26.0) (2020-04-16)
158
-
159
-
160
- ### Features
161
-
162
- * update JWT Profile for OAuth 2.0 Access Tokens to latest draft ([8c0a8a9](https://github.com/panva/jose/commit/8c0a8a950e4503cb7a756589e307286fe1116b05))
163
-
164
-
165
- ### BREAKING CHANGES
166
-
167
- * `at+JWT` JWT draft profile - in the draft's Section 2.2
168
- the claims `iat` and `jti` are now REQUIRED (was RECOMMENDED).
169
-
170
-
171
-
172
- ## [1.25.2](https://github.com/panva/jose/compare/v1.25.1...v1.25.2) (2020-04-15)
173
-
174
-
175
- ### Bug Fixes
176
-
177
- * **build:** don't publish junk files ([6e98c1a](https://github.com/panva/jose/commit/6e98c1a5f994224b9412fc47c4065b468c89fe2c))
178
-
179
-
180
-
181
- ## [1.25.1](https://github.com/panva/jose/compare/v1.25.0...v1.25.1) (2020-04-15)
182
-
183
-
184
- ### Bug Fixes
185
-
186
- * use native openssl AES Key Wrap 🤦 ([dcf8d75](https://github.com/panva/jose/commit/dcf8d75a8aca4f05fe04df64fdd2ba50bbc75bc9))
187
-
188
-
189
-
190
- ## [1.25.0](https://github.com/panva/jose/compare/v1.24.1...v1.25.0) (2020-03-11)
191
-
192
-
193
- ### Features
194
-
195
- * update JWT Profile for OAuth 2.0 Access Tokens to latest draft ([bc77a15](https://github.com/panva/jose/commit/bc77a15fab10f8a29561ef667a923b2f074fa9b3))
196
-
197
-
198
-
199
- ## [1.24.1](https://github.com/panva/jose/compare/v1.24.0...v1.24.1) (2020-03-05)
200
-
201
-
202
- ### Bug Fixes
203
-
204
- * allow importing simpler passphrases as `oct` keys ([f86bda3](https://github.com/panva/jose/commit/f86bda3bb709f29e4264fb8de45242f518128744))
205
-
206
-
207
-
208
- ## [1.24.0](https://github.com/panva/jose/compare/v1.23.0...v1.24.0) (2020-02-25)
209
-
210
-
211
- ### Features
212
-
213
- * add JWT.verify "typ" option for checking JWT Type Header parameter ([fc08426](https://github.com/panva/jose/commit/fc08426466233709b442ba21232768ddeeb94e56))
214
-
215
-
216
-
217
- ## [1.23.0](https://github.com/panva/jose/compare/v1.22.2...v1.23.0) (2020-02-18)
218
-
219
-
220
- ### Bug Fixes
221
-
222
- * **typescript:** add optional JWK.Key props and make them readonly ([b92079c](https://github.com/panva/jose/commit/b92079cb64216b8ea91082adc07ac03972dbbb0e)), closes [#67](https://github.com/panva/jose/issues/67)
223
-
224
-
225
- ### Features
226
-
227
- * add ECDH-ES with X25519 and X448 OKP keys ([38369ea](https://github.com/panva/jose/commit/38369ea3d72812abe7ecebd6dc7da164b0a2e29d))
228
- * add RSA-OAEP-384 and RSA-OAEP-512 JWE Key Management Algorithms ([7477f08](https://github.com/panva/jose/commit/7477f0831b38765a9a916b35b1d40aaf11f0e6b8))
229
-
230
-
231
-
232
- ## [1.22.2](https://github.com/panva/jose/compare/v1.22.1...v1.22.2) (2020-02-06)
233
-
234
-
235
- ### Performance Improvements
236
-
237
- * various codepaths refactored ([3e3d7dd](https://github.com/panva/jose/commit/3e3d7dd38168159e188e54c48a9f83e3a02a8fe1))
238
-
239
-
240
-
241
- ## [1.22.1](https://github.com/panva/jose/compare/v1.22.0...v1.22.1) (2020-02-03)
242
-
243
-
244
- ### Bug Fixes
245
-
246
- * actually remove the base64url proper encoding check ([eae01b5](https://github.com/panva/jose/commit/eae01b57ab9f33e8c621ffcd2a77d513a51d22b2))
247
-
248
-
249
-
250
- ## [1.22.0](https://github.com/panva/jose/compare/v1.21.1...v1.22.0) (2020-01-29)
251
-
252
-
253
- ### Features
254
-
255
- * keystore filtering by JWK Key thumbprint ([a9f6f71](https://github.com/panva/jose/commit/a9f6f7135005d6231d6f42d95c02414139a89d17))
256
-
257
-
258
- ### Performance Improvements
259
-
260
- * base64url decode, JWT.verify, JWK.Key instance re-use ([470b4c7](https://github.com/panva/jose/commit/470b4c73154e1fcf8b92726d521940e5e11c9d94))
261
-
262
-
263
-
264
- ## [1.21.1](https://github.com/panva/jose/compare/v1.21.0...v1.21.1) (2020-01-25)
265
-
266
-
267
- ### Bug Fixes
268
-
269
- * contactKDF iteration count fixed for key sizes larger than 256 bits ([70ff222](https://github.com/panva/jose/commit/70ff22227ad303e57228dc8351688531499a833a))
270
-
271
-
272
-
273
- ## [1.21.0](https://github.com/panva/jose/compare/v1.20.0...v1.21.0) (2020-01-23)
274
-
275
-
276
- ### Bug Fixes
277
-
278
- * **typescript:** don't expose non existant classes, fix decode key ([0f8bf88](https://github.com/panva/jose/commit/0f8bf886da1b5d02cd0d968d0ec02a58673df258))
279
-
280
-
281
- ### Features
282
-
283
- * add opt-in support for Unsecured JWS algorithm "none" ([3a6d17f](https://github.com/panva/jose/commit/3a6d17fdd18d8bbd074c07c2dd08f0406c16a8f1))
284
-
285
-
286
-
287
- ## [1.20.0](https://github.com/panva/jose/compare/v1.19.0...v1.20.0) (2020-01-16)
288
-
289
-
290
- ### Features
291
-
292
- * add JWTExpired error and JWTClaimInvalid claim and reason props ([a0c0c7a](https://github.com/panva/jose/commit/a0c0c7ad70f42d9b23b3e71de43599a8ac6fe1ff)), closes [#62](https://github.com/panva/jose/issues/62)
293
-
294
-
295
-
296
- ## [1.19.0](https://github.com/panva/jose/compare/v1.18.2...v1.19.0) (2020-01-13)
297
-
298
-
299
- ### Features
300
-
301
- * exposed shorthands for JWT verification profiles ([b1864e3](https://github.com/panva/jose/commit/b1864e319d1a7a42eadfa0c4b0145952e7814726))
302
-
303
-
304
-
305
- ## [1.18.2](https://github.com/panva/jose/compare/v1.18.1...v1.18.2) (2020-01-08)
306
-
307
-
308
- ### Bug Fixes
309
-
310
- * ensure asn1.js version to remove Buffer deprecation notice ([13b1106](https://github.com/panva/jose/commit/13b1106048fdeae00b09d54f05245dded85b14a7))
311
- * expose JOSENotSupported key import errors on unsupported runtimes ([bc81e5d](https://github.com/panva/jose/commit/bc81e5dec2987f6ce6dc3fa5daa23dfe620c0a34))
312
- * typo in JOSENotSupported error when x509 certs are not supported ([bb58c9c](https://github.com/panva/jose/commit/bb58c9ce52e807ca4cfad6bcbf1ab96b91778b1f))
313
-
314
-
315
-
316
- ## [1.18.1](https://github.com/panva/jose/compare/v1.18.0...v1.18.1) (2020-01-01)
317
-
318
-
319
- ### Bug Fixes
320
-
321
- * force iat past check when maxTokenAge option is used + JWT refactor ([828ad5a](https://github.com/panva/jose/commit/828ad5a33dc0cc0049923b69f43f97463295456e))
322
-
323
-
324
-
325
- ## [1.18.0](https://github.com/panva/jose/compare/v1.17.2...v1.18.0) (2019-12-31)
326
-
327
-
328
- ### Features
329
-
330
- * add JWT validation profiles for Access Tokens and Logout Tokens ([7bb5c95](https://github.com/panva/jose/commit/7bb5c953a9c6d9bd915e8ebc0608bc0649427745))
331
-
332
-
333
-
334
- ## [1.17.2](https://github.com/panva/jose/compare/v1.17.1...v1.17.2) (2019-12-17)
335
-
336
-
337
- ### Bug Fixes
338
-
339
- * skip validating iat is in the past when exp is present ([0ed5025](https://github.com/panva/jose/commit/0ed5025de30a754de95ae2587ce0f4573909b006))
340
-
341
-
342
-
343
- ## [1.17.1](https://github.com/panva/jose/compare/v1.17.0...v1.17.1) (2019-12-10)
344
-
345
-
346
- ### Bug Fixes
347
-
348
- * properly fail to import unsupported openssh keys ([bee5744](https://github.com/panva/jose/commit/bee574457f29597ccab09d51ac61b85dd7a7146a))
349
-
350
-
351
-
352
- ## [1.17.0](https://github.com/panva/jose/compare/v1.16.2...v1.17.0) (2019-12-10)
353
-
354
-
355
- ### Features
356
-
357
- * importing a certificate populates x5c and x5t thumbprints ([25a7a71](https://github.com/panva/jose/commit/25a7a71915c4f7514536cec9e7e162d0ad3b670c)), closes [#59](https://github.com/panva/jose/issues/59)
358
-
359
-
360
-
361
- ## [1.16.2](https://github.com/panva/jose/compare/v1.16.1...v1.16.2) (2019-12-05)
362
-
363
-
364
- ### Bug Fixes
365
-
366
- * handle Unencoded Payload (b64:false) with arbitrary buffer payloads ([daabedc](https://github.com/panva/jose/commit/daabedc776617f4fde427b3a5e79d8c176293132)), closes [#57](https://github.com/panva/jose/issues/57)
367
-
368
-
369
-
370
- ## [1.16.1](https://github.com/panva/jose/compare/v1.16.0...v1.16.1) (2019-12-05)
371
-
372
-
373
- ### Bug Fixes
374
-
375
- * allow PBES2 for the correct JWK `use` values ([f0d7194](https://github.com/panva/jose/commit/f0d719416ec9ca041ea88b8a983b5d899a6aa107))
376
-
377
-
378
-
379
- ## [1.16.0](https://github.com/panva/jose/compare/v1.15.1...v1.16.0) (2019-12-04)
380
-
381
-
382
- ### Features
383
-
384
- * two official jose plugins/extensions for those living on the edge ([5b27c97](https://github.com/panva/jose/commit/5b27c97ac8836ffa9f3880e009c8db5afbfbaa2c)), closes [#56](https://github.com/panva/jose/issues/56)
385
-
386
-
387
-
388
- ## [1.15.1](https://github.com/panva/jose/compare/v1.15.0...v1.15.1) (2019-11-30)
389
-
390
-
391
- ### Bug Fixes
392
-
393
- * **typescript:** export Key Input types ([0277fcd](https://github.com/panva/jose/commit/0277fcd1896af497e79190212b0719f7e62366c1))
394
-
395
-
396
-
397
- ## [1.15.0](https://github.com/panva/jose/compare/v1.14.0...v1.15.0) (2019-11-27)
398
-
399
-
400
- ### Bug Fixes
401
-
402
- * default JWT.sign `kid` option value is false for HMAC signatures ([ce77388](https://github.com/panva/jose/commit/ce7738825403f8cdb8f99cb51c096baf0dfa3af7))
403
-
404
-
405
- ### Features
406
-
407
- * allow JWK.asKey inputs for sign/verify/encrypt/decrypt operations ([5e1009a](https://github.com/panva/jose/commit/5e1009a63e4bc829009cc46d6295c00f8431024c))
408
-
409
-
410
-
411
- ## [1.14.0](https://github.com/panva/jose/compare/v1.13.0...v1.14.0) (2019-11-26)
412
-
413
-
414
- ### Features
415
-
416
- * allow JWKS.KeyStore .all and .get to filter for key curves ([ea60338](https://github.com/panva/jose/commit/ea60338ca6f58f2626992a38da76812477ce4540))
417
-
418
-
419
-
420
- ## [1.13.0](https://github.com/panva/jose/compare/v1.12.1...v1.13.0) (2019-11-23)
421
-
422
-
423
- ### Features
424
-
425
- * return the CEK from JWE.decrypt operation with { complete: true } ([c3eb845](https://github.com/panva/jose/commit/c3eb8450b98b2f5ecc127d69afe85a7ae2cc5aaa))
426
-
427
-
428
-
429
- ## [1.12.1](https://github.com/panva/jose/compare/v1.12.0...v1.12.1) (2019-11-14)
430
-
431
-
432
-
433
- ## [1.12.0](https://github.com/panva/jose/compare/v1.11.0...v1.12.0) (2019-11-05)
434
-
435
-
436
- ### Features
437
-
438
- * add JWS.verify encoding and parsing options ([6bb66d4](https://github.com/panva/jose/commit/6bb66d4f0b4c96f2da8ac5f14fda6bc4f53f2994))
439
-
440
-
441
-
442
- ## [1.11.0](https://github.com/panva/jose/compare/v1.10.2...v1.11.0) (2019-11-03)
443
-
444
-
445
- ### Features
446
-
447
- * expose crypto.KeyObject instances in supported runtimes ([8ea9683](https://github.com/panva/jose/commit/8ea968312e97ed0f992fab909a20e7993159ec45))
448
-
449
-
450
-
451
- ## [1.10.2](https://github.com/panva/jose/compare/v1.10.1...v1.10.2) (2019-10-29)
452
-
453
-
454
- ### Bug Fixes
455
-
456
- * only use secp256k1 keys for signing/verification ([9588223](https://github.com/panva/jose/commit/95882232d6d409a321b6a8c168f5b78ebbdabf95))
457
-
458
-
459
-
460
- ## [1.10.1](https://github.com/panva/jose/compare/v1.10.0...v1.10.1) (2019-10-04)
461
-
462
-
463
- ### Bug Fixes
464
-
465
- * throw proper error when runtime doesn't support OKP ([0a16efb](https://github.com/panva/jose/commit/0a16efb)), closes [#48](https://github.com/panva/jose/issues/48)
466
-
467
-
468
-
469
- ## [1.10.0](https://github.com/panva/jose/compare/v1.9.2...v1.10.0) (2019-10-01)
470
-
471
-
472
- ### Features
473
-
474
- * rename package ([26f4cf2](https://github.com/panva/jose/commit/26f4cf2))
475
-
476
-
477
-
478
- ## [1.9.2](https://github.com/panva/jose/compare/v1.9.1...v1.9.2) (2019-09-16)
479
-
480
-
481
- ### Bug Fixes
482
-
483
- * keystore.toJWKS(true) does not throw on public keys ([81abdfa](https://github.com/panva/jose/commit/81abdfa)), closes [#42](https://github.com/panva/jose/issues/42)
484
-
485
-
486
-
487
- ## [1.9.1](https://github.com/panva/jose/compare/v1.9.0...v1.9.1) (2019-09-10)
488
-
489
-
490
-
491
- ## [1.9.0](https://github.com/panva/jose/compare/v1.8.0...v1.9.0) (2019-08-24)
492
-
493
-
494
- ### Features
495
-
496
- * allow JWKS.asKeyStore to swallow errors ([78398d3](https://github.com/panva/jose/commit/78398d3))
497
-
498
-
499
-
500
- ## [1.8.0](https://github.com/panva/jose/compare/v1.7.0...v1.8.0) (2019-08-22)
501
-
502
-
503
- ### Features
504
-
505
- * added Node.js lts/dubnium support for runtime supported features ([67a8601](https://github.com/panva/jose/commit/67a8601))
506
-
507
-
508
-
509
- ## [1.7.0](https://github.com/panva/jose/compare/v1.6.1...v1.7.0) (2019-08-20)
510
-
511
-
512
- ### Features
513
-
514
- * add RSA-OAEP-256 support (when a node version supports it) ([28d7cf8](https://github.com/panva/jose/commit/28d7cf8)), closes [#29](https://github.com/panva/jose/issues/29)
515
-
516
-
517
-
518
- ## [1.6.1](https://github.com/panva/jose/compare/v1.6.0...v1.6.1) (2019-07-29)
519
-
520
-
521
- ### Bug Fixes
522
-
523
- * properly pad calculated RSA primes ([dd121ce](https://github.com/panva/jose/commit/dd121ce))
524
-
525
-
526
-
527
- ## [1.6.0](https://github.com/panva/jose/compare/v1.5.2...v1.6.0) (2019-07-27)
528
-
529
-
530
- ### Bug Fixes
531
-
532
- * use the correct ECPrivateKey version when importing EC JWK ([24acd20](https://github.com/panva/jose/commit/24acd20))
533
-
534
-
535
- ### Features
536
-
537
- * electron v6.x support ([e7ad82c](https://github.com/panva/jose/commit/e7ad82c))
538
-
539
-
540
-
541
- ## [1.5.2](https://github.com/panva/jose/compare/v1.5.1...v1.5.2) (2019-07-27)
542
-
543
-
544
- ### Bug Fixes
545
-
546
- * importing x5c in electron requires the input split ([181fd09](https://github.com/panva/jose/commit/181fd09))
547
-
548
-
549
-
550
- ## [1.5.1](https://github.com/panva/jose/compare/v1.5.0...v1.5.1) (2019-07-27)
551
-
552
-
553
- ### Bug Fixes
554
-
555
- * correctly pad integers when importing RSA JWK ([1dc7f35](https://github.com/panva/jose/commit/1dc7f35))
556
-
557
-
558
-
559
- ## [1.5.0](https://github.com/panva/jose/compare/v1.4.1...v1.5.0) (2019-07-23)
560
-
561
-
562
- ### Features
563
-
564
- * validate JWTs according to a JWT profile - ID Token ([6c98b61](https://github.com/panva/jose/commit/6c98b61))
565
-
566
-
567
-
568
- ## [1.4.1](https://github.com/panva/jose/compare/v1.4.0...v1.4.1) (2019-07-14)
569
-
570
-
571
- ### Bug Fixes
572
-
573
- * honour the JWT.sign `jti` option ([36c9ce2](https://github.com/panva/jose/commit/36c9ce2)), closes [#33](https://github.com/panva/jose/issues/33)
574
-
575
-
576
-
577
- ## [1.4.0](https://github.com/panva/jose/compare/v1.3.0...v1.4.0) (2019-07-08)
578
-
579
-
580
- ### Features
581
-
582
- * add secp256k1 EC Key curve and ES256K ([211d7af](https://github.com/panva/jose/commit/211d7af))
583
-
584
-
585
-
586
- ## [1.3.0](https://github.com/panva/jose/compare/v1.0.2...c51dc28) (2019-06-21)
587
-
588
-
589
- ### Features
590
-
591
- * compute private RSA key p, q, dp, dq, qi when omitted ([6e3d6fd](https://github.com/panva/jose/commit/6e3d6fd)), closes [#26](https://github.com/panva/jose/issues/26)
592
- * add support for JWK x5c, x5t and x5t#S256 ([9d46c48](https://github.com/panva/jose/commit/9d46c48))
593
- * instances of JWKS.KeyStore are now iterable (e.g. for ... of) ([2eae293](https://github.com/panva/jose/commit/2eae293))
594
-
595
- ### Bug Fixes
596
-
597
- * limit calculation of missing RSA private components ([5b53cb0](https://github.com/panva/jose/commit/5b53cb0))
598
- * reject rsa keys without all factors and exponents with a specific message ([b0ff436](https://github.com/panva/jose/commit/b0ff436))
599
-
600
- ### Deprecations
601
-
602
- - this deprecates the use of `JWK.importKey` in favor of
603
- `JWK.asKey`
604
- - this deprecates the use of `JWKS.KeyStore.fromJWKS` in favor of
605
- `JWKS.asKeyStore`
606
-
607
- Both `JWK.importKey` and `JWKS.KeyStore.fromJWKS` could have resulted
608
- in the process getting blocked when large bitsize RSA private keys
609
- were missing their components and could also result in an endless
610
- calculation loop when the private key's private exponent was outright
611
- invalid or tampered with.
612
-
613
- The new methods still allow to import private RSA keys with these
614
- optimization key parameters missing but it is disabled by default and one
615
- should choose to enable it when working with keys from trusted sources
616
-
617
- It is recommended not to use `jose` versions with this feature in
618
- its original on-by-default form - v1.1.0 and v1.2.0
619
-
620
-
621
-
622
- ## [1.0.2](https://github.com/panva/jose/compare/v1.0.1...v1.0.2) (2019-05-13)
623
-
624
-
625
- ### Bug Fixes
626
-
627
- * add missing keystore.toJWKS() .d.ts definition ([c7a8606](https://github.com/panva/jose/commit/c7a8606)), closes [#25](https://github.com/panva/jose/issues/25)
628
-
629
-
630
-
631
- ## [1.0.1](https://github.com/panva/jose/compare/v1.0.0...v1.0.1) (2019-04-27)
632
-
633
-
634
- ### Bug Fixes
635
-
636
- * oct key ts "k" type fix ([0750d2c](https://github.com/panva/jose/commit/0750d2c))
637
-
638
-
639
-
640
- ## [1.0.0](https://github.com/panva/jose/compare/v0.12.0...v1.0.0) (2019-04-23)
641
-
642
-
643
- ### Bug Fixes
644
-
645
- * fail to import invalid PEM formatted strings and buffers ([857dc2b](https://github.com/panva/jose/commit/857dc2b))
646
-
647
-
648
- ### Features
649
-
650
- * add JWK key_ops support, fix .algorithms() op returns ([23b874c](https://github.com/panva/jose/commit/23b874c))
651
- * add key.toPEM() export function with optional encryption ([1159b0d](https://github.com/panva/jose/commit/1159b0d))
652
- * add OKP Key and EdDSA sign/verify support ([2dbd3ed](https://github.com/panva/jose/commit/2dbd3ed)), closes [#12](https://github.com/panva/jose/issues/12)
653
-
654
-
655
- ### BREAKING CHANGES
656
-
657
- * key.algorithms(op) un+wrapKey was split into correct
658
- wrapKey/unwrapKey/deriveKey returns
659
- * keystore.all and keystore.get `operation` option was
660
- removed, `key_ops: string[]` supersedes it
661
- * Node.js minimal version is now v12.0.0 due to its
662
- added EdDSA support (crypto.sign, crypto.verify and eddsa key objects)
663
-
664
-
665
-
666
- ## [0.12.0](https://github.com/panva/jose/compare/v0.11.5...v0.12.0) (2019-04-07)
667
-
668
-
669
- ### Reverts
670
-
671
- * add EC P-256K JWK and ES256K sign/verify support ([e21fea1](https://github.com/panva/jose/commit/e21fea1))
672
-
673
-
674
- ### BREAKING CHANGES
675
-
676
- * removing ES256K alg and EC P-256K crv support until the
677
- IETF WG decides on what the final names will be.
678
-
679
-
680
-
681
- ## [0.11.5](https://github.com/panva/jose/compare/v0.11.4...v0.11.5) (2019-04-04)
682
-
683
-
684
- ### Features
685
-
686
- * add key.secret<boolean> and key.type<string> for completeness ([2dd7053](https://github.com/panva/jose/commit/2dd7053))
687
- * add key.thumbprint always returning the JWK Thumbprint (RFC7638) ([65db7e0](https://github.com/panva/jose/commit/65db7e0))
688
-
689
-
690
-
691
- ## [0.11.4](https://github.com/panva/jose/compare/v0.11.3...v0.11.4) (2019-03-28)
692
-
693
-
694
- ### Bug Fixes
695
-
696
- * properly restrict EC curves in generate(Sync) ([764b863](https://github.com/panva/jose/commit/764b863))
697
- * remove unintended exposure of private material via enumerables ([946d9df](https://github.com/panva/jose/commit/946d9df))
698
-
699
-
700
-
701
- ## [0.11.3](https://github.com/panva/jose/compare/v0.11.2...v0.11.3) (2019-03-27)
702
-
703
-
704
- ### Bug Fixes
705
-
706
- * throw on unsupported EC curves ([cfa4222](https://github.com/panva/jose/commit/cfa4222))
707
-
708
-
709
- ### Features
710
-
711
- * add EC P-256K JWK and ES256K sign/verify support ([2e33e1c](https://github.com/panva/jose/commit/2e33e1c))
712
-
713
-
714
-
715
- ## [0.11.2](https://github.com/panva/jose/compare/v0.11.1...v0.11.2) (2019-03-19)
716
-
717
-
718
- ### Bug Fixes
719
-
720
- * internal symbol method is now really a symbol ([925d47c](https://github.com/panva/jose/commit/925d47c))
721
- * key.toJWK() fixed on windows ([57f1692](https://github.com/panva/jose/commit/57f1692)), closes [#17](https://github.com/panva/jose/issues/17)
722
-
723
-
724
- ## [0.11.1](https://github.com/panva/jose/compare/v0.11.0...v0.11.1) (2019-03-17)
725
-
726
-
727
- ### Bug Fixes
728
-
729
- * restrict RS key algorithms by the key's bit size ([9af295b](https://github.com/panva/jose/commit/9af295b))
730
-
731
-
732
- ## [0.11.0](https://github.com/panva/jose/compare/v0.10.0...v0.11.0) (2019-03-16)
733
-
734
-
735
- ### Bug Fixes
736
-
737
- * all JWA defined RSA operations require key of 2048 or more ([cc70c5d](https://github.com/panva/jose/commit/cc70c5d))
738
- * use correct salt length for RSASSA-PSS ([e936d54](https://github.com/panva/jose/commit/e936d54))
739
-
740
-
741
- ### BREAKING CHANGES
742
-
743
- * all [JWA](https://tools.ietf.org/html/rfc7518) defined
744
- RSA based operations require key size of 2048 bits or more.
745
-
746
-
747
-
748
- ## [0.10.0](https://github.com/panva/jose/compare/v0.9.2...v0.10.0) (2019-03-12)
749
-
750
-
751
- ### Bug Fixes
752
-
753
- * do not list "dir" under wrap/unwrapKey operations ([17b37d3](https://github.com/panva/jose/commit/17b37d3))
754
-
755
-
756
- ### Features
757
-
758
- * keystore .all and .get operation option ([d349ba9](https://github.com/panva/jose/commit/d349ba9))
759
-
760
-
761
- ### BREAKING CHANGES
762
-
763
- * "dir" is no longer returned as wrap/unwrapKey key
764
- operation
765
-
766
-
767
-
768
- ## [0.9.2](https://github.com/panva/jose/compare/v0.9.1...v0.9.2) (2019-03-05)
769
-
770
-
771
- ### Bug Fixes
772
-
773
- * "dir" is only available on keys with correct lengths ([6854860](https://github.com/panva/jose/commit/6854860))
774
- * do not 'in' operator when importing keys as string ([be3f4e4](https://github.com/panva/jose/commit/be3f4e4))
775
-
776
-
777
-
778
- ## [0.9.1](https://github.com/panva/jose/compare/v0.9.0...v0.9.1) (2019-03-02)
779
-
780
-
781
- ### Bug Fixes
782
-
783
- * only import RSA, EC and oct successfully ([e5e02fc](https://github.com/panva/jose/commit/e5e02fc))
784
-
785
-
786
- # 0.9.0 (2019-03-02)
787
-
788
- Initial release
789
-
790
- ### Implemented Features
791
-
792
- - JSON Web Signature (JWS) - [RFC7515][spec-jws]
793
- - JSON Web Encryption (JWE) - [RFC7516][spec-jwe]
794
- - JSON Web Key (JWK) - [RFC7517][spec-jwk]
795
- - JSON Web Algorithms (JWA) - [RFC7518][spec-jwa]
796
- - JSON Web Token (JWT) - [RFC7519][spec-jwt]
797
- - JSON Web Key (JWK) Thumbprint - [RFC7638][spec-thumbprint]
798
- - JWS Unencoded Payload Option - [RFC7797][spec-b64]
799
-
800
- | JWK Key Types | Supported ||
801
- | -- | -- | -- |
802
- | RSA | ✓ | RSA |
803
- | Elliptic Curve | ✓ | EC |
804
- | Octet sequence | ✓ | oct |
805
-
806
- | Serialization | JWS Sign | JWS Verify | JWE Encrypt | JWE Decrypt |
807
- | -- | -- | -- | -- | -- |
808
- | Compact | ✓ | ✓ | ✓ | ✓ |
809
- | General JSON | ✓ | ✓ | ✓ | ✓ |
810
- | Flattened JSON | ✓ | ✓ | ✓ | ✓ |
811
-
812
- | JWS Algorithms | Supported ||
813
- | -- | -- | -- |
814
- | RSASSA-PKCS1-v1_5 | ✓ | RS256, RS384, RS512 |
815
- | RSASSA-PSS | ✓ | PS256, PS384, PS512 |
816
- | ECDSA | ✓ | ES256, ES384, ES512 |
817
- | HMAC with SHA-2 | ✓ | HS256, HS384, HS512 |
818
-
819
- | JWE Key Management Algorithms | Supported ||
820
- | -- | -- | -- |
821
- | AES | ✓ | A128KW, A192KW, A256KW |
822
- | AES GCM | ✓ | A128GCMKW, A192GCMKW, A256GCMKW |
823
- | Direct Key Agreement | ✓ | dir |
824
- | RSAES OAEP | ✓<sup>*</sup> | RSA-OAEP <sub>(<sup>*</sup>RSA-OAEP-256 is not supported due to its lack of support in Node.js)</sub> |
825
- | RSAES-PKCS1-v1_5 | ✓ | RSA1_5 |
826
- | PBES2 | ✓ | PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW |
827
- | ECDH-ES | ✓ | ECDH-ES, ECDH-ES+A128KW, ECDH-ES+A192KW, ECDH-ES+A256KW |
828
-
829
- | JWE Content Encryption Algorithms | Supported ||
830
- | -- | -- | -- |
831
- | AES GCM | ✓ | A128GCM, A192GCM, A256GCM |
832
- | AES_CBC_HMAC_SHA2 | ✓ | A128CBC-HS256, A192CBC-HS384, A256CBC-HS512 |
833
-
834
- [spec-b64]: https://tools.ietf.org/html/rfc7797
835
- [spec-jwa]: https://tools.ietf.org/html/rfc7518
836
- [spec-jwe]: https://tools.ietf.org/html/rfc7516
837
- [spec-jwk]: https://tools.ietf.org/html/rfc7517
838
- [spec-jws]: https://tools.ietf.org/html/rfc7515
839
- [spec-jwt]: https://tools.ietf.org/html/rfc7519
840
- [spec-thumbprint]: https://tools.ietf.org/html/rfc7638