Comparing version 1.27.1 to 1.27.2
@@ -5,2 +5,11 @@ # Change Log | ||
## [1.27.2](https://github.com/panva/jose/compare/v1.27.1...v1.27.2) (2020-07-01) | ||
### Bug Fixes | ||
* 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) | ||
## [1.27.1](https://github.com/panva/jose/compare/v1.27.0...v1.27.1) (2020-06-01) | ||
@@ -7,0 +16,0 @@ |
@@ -7,2 +7,3 @@ /* global BigInt */ | ||
const { keyObjectSupported } = require('./runtime_support') | ||
const { createPublicKey } = require('./key_object') | ||
@@ -93,7 +94,18 @@ const base64url = require('./base64url') | ||
const { privateKey, algorithm: { parameters: { value: crv } } } = PrivateKeyInfo.decode(der) | ||
const { privateKey: d, publicKey: { data: publicKey } } = ECPrivateKey.decode(privateKey) | ||
const { privateKey: d, publicKey } = ECPrivateKey.decode(privateKey) | ||
const x = publicKey.slice(1, ((publicKey.length - 1) / 2) + 1) | ||
const y = publicKey.slice(((publicKey.length - 1) / 2) + 1) | ||
if (typeof publicKey === 'undefined') { | ||
if (keyObjectSupported) { | ||
return { | ||
...keyObjectToJWK.ec.public(createPublicKey(keyObject)), | ||
d: base64url.encodeBuffer(d) | ||
} | ||
} | ||
throw new errors.JOSENotSupported('Private EC keys without the public key embedded are not supported in your Node.js runtime version') | ||
} | ||
const x = publicKey.data.slice(1, ((publicKey.data.length - 1) / 2) + 1) | ||
const y = publicKey.data.slice(((publicKey.data.length - 1) / 2) + 1) | ||
return { | ||
@@ -100,0 +112,0 @@ kty: 'EC', |
{ | ||
"name": "jose", | ||
"version": "1.27.1", | ||
"version": "1.27.2", | ||
"description": "JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231567
4849