Commit graph

77 commits

Author SHA1 Message Date
Filip Skokan
b8b668ebbd lint: fix lint 2021-01-18 13:56:01 +01:00
Filip Skokan
d5af559a94 perf: improve base64url encoding when available in Node.js 2021-01-18 13:43:56 +01:00
Filip Skokan
921737fa83 style: upgrade standard 2020-10-29 20:43:19 +01:00
Filip Skokan
6c35c519c9 refactor: removed deprecated methods and utilities
BREAKING CHANGE: deprecated method `JWK.importKey` was removed
BREAKING CHANGE: deprecated method `JWKS.KeyStore.fromJWKS` was removed
BREAKING CHANGE: the use of unregistered curve name P-256K for secp256k1
was removed
2020-09-08 14:12:04 +02:00
Filip Skokan
e8ad38993e
fix: handle private EC keys without public component (#86)
Only possible to handle when KeyObject API is available in the runtime.

closes #85
2020-07-01 13:13:34 +02:00
Filip Skokan
7c1cab196e feat: add opt-in objects to verify using embedded JWS Header public keys 2020-05-04 22:37:11 +02:00
Filip Skokan
27b77b9edc refactor: get rid of multiple asn1 OID mappings 2020-04-07 20:10:55 +02:00
Kyle Den Hartog
419d09b4d5
refactor: use consistent BigInt(n) syntax 2020-02-24 08:57:35 +01:00
Filip Skokan
9e7444b7d2 refactor: removed asn1.js in favor of slimmer @panva/asn1.js
resolves #61
2020-02-18 16:12:10 +01:00
Filip Skokan
f7e463d0dd improvement: private / public key input support improved in node 10 2020-02-14 21:17:19 +01:00
Filip Skokan
38369ea3d7 feat: add ECDH-ES with X25519 and X448 OKP keys 2020-02-13 16:26:09 +01:00
Filip Skokan
594c3e4e43 improvement: dsaEncoding is now available in lts/erbium 2020-02-13 15:31:28 +01:00
Filip Skokan
3e3d7dd381 perf: various codepaths refactored 2020-02-06 14:18:48 +01:00
Filip Skokan
eae01b57ab fix: actually remove the base64url proper encoding check
This should've landed with 470b4c7
2020-02-03 14:07:28 +01:00
Filip Skokan
93068a63c8 refactor: improve performance when decoding base64url values
When creating a Buffer from a string, this encoding will also correctly
accept "URL and Filename Safe Alphabet".
2020-01-28 16:41:03 +01:00
Filip Skokan
bc81e5dec2 fix: expose JOSENotSupported key import errors on unsupported runtimes 2020-01-08 13:17:45 +01:00
Filip Skokan
bb58c9ce52 fix: typo in JOSENotSupported error when x509 certs are not supported 2020-01-07 21:03:00 +01:00
Filip Skokan
a9f1d4b195 refactor: introduce various registries to prepare for extension modules 2019-12-03 18:54:37 +01:00
Filip Skokan
99eeb43d0e refactor: use dsaEncoding for ECDSA when supported 2019-11-29 10:57:20 +01:00
Filip Skokan
d45f845c45 refactor: backwards compatibility for node < 12 2019-11-27 22:04:15 +01:00
Filip Skokan
5e1009a63e feat: allow JWK.asKey inputs for sign/verify/encrypt/decrypt operations 2019-11-27 22:04:14 +01:00
Filip Skokan
6bb66d4f0b feat: add JWS.verify encoding and parsing options 2019-11-05 20:09:34 +01:00
Filip Skokan
809e3cb682 ci: coverage with electron 2019-09-26 14:59:57 +02:00
Filip Skokan
1db9fc9cd1 refactor: don't swallow invalid encoding errors 2019-09-25 22:18:47 +02:00
Filip Skokan
06758102b2 refactor: rename node_support to runtime_support 2019-09-10 12:14:15 +02:00
Filip Skokan
67a8601b09 feat: added Node.js lts/dubnium support for runtime supported features 2019-08-22 20:40:02 +02:00
Filip Skokan
28d7cf8c78 feat: add RSA-OAEP-256 support (when a node version supports it)
resolves #29
2019-08-20 19:22:42 +02:00
Filip Skokan
dd121ce38d fix: properly pad calculated RSA primes 2019-07-29 15:30:25 +02:00
Filip Skokan
e7ad82cbbc feat: electron v6.x support 2019-07-27 21:19:14 +02:00
Filip Skokan
24acd201b6 fix: use the correct ECPrivateKey version when importing EC JWK 2019-07-27 16:35:39 +02:00
Filip Skokan
1dc7f35bd2 fix: correctly pad integers when importing RSA JWK 2019-07-27 11:14:01 +02:00
Filip Skokan
418e311c8d chore: update dev deps, code lint 2019-07-21 18:05:57 +02:00
Filip Skokan
211d7af5db feat: add secp256k1 EC Key curve and ES256K
This is as per
- https://tools.ietf.org/html/draft-ietf-cose-webauthn-algorithms-01
- https://mailarchive.ietf.org/arch/msg/cose/91MouVA43DefbpQOB7l5daCEeIc
2019-07-08 22:04:29 +02:00
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
9d46c48fd5 feat: add support for JWK x5c, x5t and x5t#S256 2019-05-25 22:34:28 +02:00
Filip Skokan
6e3d6fd111 feat: compute private RSA key p, q, dp, dq, qi when omitted
resolves #26
2019-05-23 19:51:45 +02:00
Filip Skokan
b0ff436daf fix: reject rsa keys without all factors and exponents with a specific message 2019-05-23 19:20:30 +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
1159b0df4e feat: add key.toPEM() export function with optional encryption 2019-04-23 14:30:50 +02:00
Filip Skokan
2dbd3ed43a feat: add OKP Key and EdDSA sign/verify support
BREAKING CHANGE: node.js minimal version is now v12.0.0 due to its
added EdDSA support (crypto.sign, crypto.verify and eddsa key objects)

resolves #12
2019-04-23 14:30:49 +02:00
Filip Skokan
e21fea106b revert: add EC P-256K JWK and ES256K sign/verify support
BREAKING CHANGE: removing ES256K alg and EC P-256K crv support until the
IETF WG decides on what the final names will be.
2019-04-07 14:13:10 +02:00
Filip Skokan
2ad22792ff refactor: use exported KeyObject when available 2019-03-28 20:51:00 +01:00
Filip Skokan
764b86309c fix: properly restrict EC curves in generate(Sync) 2019-03-28 09:42:27 +01:00
Filip Skokan
fb7ae33ce2 chore: remove done todos
[skip ci]
2019-03-27 11:17:59 +01:00
Filip Skokan
2e33e1cc2b feat: add EC P-256K JWK and ES256K sign/verify support 2019-03-27 10:35:02 +01:00
Filip Skokan
c5c985b1ab refactor: use pem from asn1.js 2019-03-26 20:47:01 +01:00
Filip Skokan
12357f8ae1 refactor: source in asn1.js to remove some transitive dependencies 2019-03-26 18:24:10 +01:00
Filip Skokan
6172bcb18e refactor: dry resolveNodeAlg 2019-03-26 12:57:21 +01:00
Filip Skokan
a6d83d1d8e refactor: explicitly check EC curves supported 2019-03-26 09:42:22 +01:00
Filip Skokan
8892994922 refactor: revert the windows fix, bump keyto 2019-03-25 09:49:50 +01:00