Comparing version 1.15.0 to 1.15.1
@@ -5,2 +5,11 @@ # Change Log | ||
## [1.15.1](https://github.com/panva/jose/compare/v1.15.0...v1.15.1) (2019-11-30) | ||
### Bug Fixes | ||
* **typescript:** export Key Input types ([0277fcd](https://github.com/panva/jose/commit/0277fcd1896af497e79190212b0719f7e62366c1)) | ||
# [1.15.0](https://github.com/panva/jose/compare/v1.14.0...v1.15.0) (2019-11-27) | ||
@@ -7,0 +16,0 @@ |
@@ -8,3 +8,4 @@ const { KeyObject, sign, verify } = require('crypto') | ||
keyObjectSupported: !!KeyObject && major >= 12, | ||
edDSASupported: !!sign && !!verify | ||
edDSASupported: !!sign && !!verify, | ||
dsaEncodingSupported: major > 13 || (major === 13 && minor >= 2) | ||
} |
@@ -8,7 +8,12 @@ const { strict: assert } = require('assert') | ||
const { asInput } = require('../help/key_object') | ||
const { dsaEncodingSupported } = require('../help/runtime_support') | ||
let sign, verify | ||
if (signOneShot) { | ||
if (dsaEncodingSupported) { // >= 13.2.0 | ||
sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { | ||
return signOneShot(nodeAlg, payload, { key: asInput(keyObject, false), dsaEncoding: 'ieee-p1363' }) | ||
} | ||
} else if (signOneShot) { // >= 12.0.0 | ||
sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { | ||
return derToJose(signOneShot(nodeAlg, payload, asInput(keyObject, false)), jwaAlg) | ||
@@ -22,5 +27,13 @@ } | ||
if (verifyOneShot) { | ||
if (dsaEncodingSupported) { // >= 13.2.0 | ||
verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { | ||
try { | ||
return verifyOneShot(nodeAlg, payload, { key: asInput(keyObject, true), dsaEncoding: 'ieee-p1363' }, signature) | ||
} catch (err) { | ||
return false | ||
} | ||
} | ||
} else if (verifyOneShot) { // >= 12.0.0 | ||
verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { | ||
try { | ||
return verifyOneShot(nodeAlg, payload, asInput(keyObject, true), joseToDer(signature, jwaAlg)) | ||
@@ -27,0 +40,0 @@ } catch (err) { |
{ | ||
"name": "jose", | ||
"version": "1.15.0", | ||
"version": "1.15.1", | ||
"description": "JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -28,6 +28,5 @@ /// <reference types="node" /> | ||
export type KeyInput = PrivateKeyInput | PublicKeyInput | string | Buffer; | ||
export type ProduceKeyInput = JWK.Key | KeyObject | KeyInput | JWKOctKey | JWKRSAKey | JWKECKey | JWKOKPKey; | ||
export type ConsumeKeyInput = ProduceKeyInput | JWKS.KeyStore; | ||
type ProduceKeyInput = JWK.Key | KeyObject | KeyInput | JWKOctKey | JWKRSAKey | JWKECKey | JWKOKPKey; | ||
type ConsumeKeyInput = ProduceKeyInput | JWKS.KeyStore; | ||
export interface JWKOctKey extends BasicParameters { // no x5c | ||
@@ -34,0 +33,0 @@ kty: 'oct'; |
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
211935
4667