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

jws

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jws - npm Package Compare versions

Comparing version 3.1.4 to 3.1.5

11

lib/sign-stream.js
/*global module*/
var base64url = require('base64url');
var Buffer = require('safe-buffer').Buffer;
var DataStream = require('./data-stream');

@@ -9,2 +9,11 @@ var jwa = require('jwa');

function base64url(string, encoding) {
return Buffer
.from(string, encoding)
.toString('base64')
.replace(/=/g, '')
.replace(/\+/g, '-')
.replace(/\//g, '_');
}
function jwsSecuredInput(header, payload, encoding) {

@@ -11,0 +20,0 @@ encoding = encoding || 'utf8';

6

lib/verify-stream.js
/*global module*/
var base64url = require('base64url');
var Buffer = require('safe-buffer').Buffer;
var DataStream = require('./data-stream');

@@ -23,3 +23,3 @@ var jwa = require('jwa');

var encodedHeader = jwsSig.split('.', 1)[0];
return safeJsonParse(base64url.decode(encodedHeader, 'binary'));
return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary'));
}

@@ -38,3 +38,3 @@

var payload = jwsSig.split('.')[1];
return base64url.decode(payload, encoding);
return Buffer.from(payload, 'base64').toString(encoding);
}

@@ -41,0 +41,0 @@

{
"name": "jws",
"version": "3.1.4",
"version": "3.1.5",
"description": "Implementation of JSON Web Signatures",

@@ -27,4 +27,3 @@ "main": "index.js",

"dependencies": {
"base64url": "^2.0.0",
"jwa": "^1.1.4",
"jwa": "^1.1.5",
"safe-buffer": "^5.0.1"

@@ -31,0 +30,0 @@ },

@@ -119,5 +119,5 @@ # node-jws [![Build Status](https://secure.travis-ci.org/brianloveswords/node-jws.png)](http://travis-ci.org/brianloveswords/node-jws)

// is equivilant to this:
const signer = jws.createSign(
const signer = jws.createSign({
header: { alg: 'RS256' },
);
});
privateKeyStream.pipe(signer.privateKey);

@@ -124,0 +124,0 @@ payloadStream.pipe(signer.payload);

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