Commit graph

28 commits

Author SHA1 Message Date
Filip Skokan
5b53cb0155 fix: limit calculation of missing RSA private components
- this deprecates the use of `JWK.importKey` in favor of
`JWK.asKey`
- this deprecates the use of `JWKS.KeyStore.fromJWKS` in favor of
`JWKS.asKeyStore`

Both `JWK.importKey` and `JWKS.KeyStore.fromJWKS` could have resulted
in the process getting blocked when large bitsize RSA private keys
were missing their components and could also result in an endless
calculation loop when the private key's private exponent was outright
invalid or tampered with.

The new methods still allow to import private RSA keys with these
optimization key parameters missing but its disabled by default and one
should choose to enable it when working with keys from trusted sources

It is recommended not to use @panva/jose versions with this feature in
its original on-by-default form - v1.1.0 and v1.2.0 These will
2019-06-20 23:32:13 +02:00
Filip Skokan
23b874cc20 feat: add JWK key_ops support, fix .algorithms() op returns
BREAKING CHANGE: key.algorithms(op) un+wrapKey was split into correct
wrapKey/unwrapKey/deriveKey returns

BREAKING CHANGE: keystore.all and keystore.get `operation` option was
removed, `key_ops: string[]` supersedes it
2019-04-23 14:30:51 +02:00
Filip Skokan
a8ef20e450 refactor: use private instance fields where possible 2019-04-23 14:30:50 +02:00
Filip Skokan
988bbafdd6 refactor: skip validating jws disjoint when header's missing 2019-03-28 23:32:02 +01:00
Filip Skokan
fe0003603d refactor: remove ec length, generate only returns keyobject 2019-03-20 18:46:36 +01:00
Filip Skokan
d349ba96d7 feat: keystore .all and .get operation option 2019-03-11 22:15:34 +01:00
Filip Skokan
6453e1ffc9 refactor: require order and base64url split encode buffer/string 2019-03-06 22:12:43 +01:00
Filip Skokan
e9f5fdcfc8 feat: verify and decrypt complete option returns the matched key as well 2019-02-26 22:45:02 +01:00
Filip Skokan
0a6027d62a refactor: add .d.ts and simplify errors 2019-02-25 21:27:39 +01:00
Filip Skokan
546840d55c feat: throw JOSEMultiError when general formats and keystore use 2019-02-24 14:05:57 +01:00
Filip Skokan
77fe241aa7 feat: add decrypt/verify complete and algorithm options 2019-02-22 22:26:33 +01:00
Filip Skokan
962c1f5021 feat: b64 (rfc7797) support 2019-02-21 22:51:32 +01:00
Filip Skokan
7bc3cc4c71 feat: resolving alg/enc, crit members, add tests 2019-02-20 23:12:08 +01:00
Filip Skokan
869438c798 refactor: jwe/jws serializer detection 2019-02-19 23:30:57 +01:00
Filip Skokan
cc7d53a5ce feat: decrypt keystore support 2019-02-17 16:22:44 +01:00
Filip Skokan
bcd920600d test: keystore verify 2019-02-16 14:12:47 +01:00
Filip Skokan
dca4969c4f feat: verify keystore support 2019-02-16 13:41:11 +01:00
Filip Skokan
cc89d4e02b refactor: cleanup, TODO chores 2019-02-10 21:39:59 +01:00
Filip Skokan
775ea638b6 chore: cleanup 2019-02-10 17:45:55 +01:00
Filip Skokan
05251b81c6 feat: add messy encrypt/decrypt structure and shorthands 2019-02-09 20:04:15 +01:00
Filip Skokan
ac1bb358d7 test: jwe cookbook decrypt 2019-02-09 19:26:02 +01:00
Filip Skokan
5c4346e9cd test: start with cookbook tests 2019-02-09 18:35:29 +01:00
Filip Skokan
b247fc33df feat: encryption with AES_CBC_HMAC_SHA2 2019-01-26 14:24:12 +01:00
Filip Skokan
faa45bc03b refactor: remove generic errors 2019-01-20 19:37:27 +01:00
Filip Skokan
a752663317 refactor: move keys around 2019-01-19 17:24:43 +01:00
Filip Skokan
033a025a34 feat: jwt.verify 2019-01-19 16:33:17 +01:00
Filip Skokan
c4e2636c0e refactor: move jwa away from keys 2018-12-08 15:17:21 +01:00
Filip Skokan
b8709756f0 chore: initial commit 2018-11-03 12:30:32 +01:00