Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jose

Package Overview
Dependencies
Maintainers
1
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jose - npm Package Compare versions

Comparing version 1.15.0 to 1.15.1

9

CHANGELOG.md

@@ -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 @@

3

lib/help/runtime_support.js

@@ -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';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc