Socket
Socket
Sign inDemoInstall

jwa

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwa - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

.travis.yml

4

package.json
{
"name": "jwa",
"version": "0.0.0",
"description": "JWA implementation, supports all algorithms",
"version": "0.0.1",
"description": "JWA implementation (supports all JWS algorithms)",
"main": "index.js",

@@ -6,0 +6,0 @@ "directories": {

@@ -53,2 +53,24 @@ const base64url = require('base64url');

BIT_DEPTHS.forEach(function (bits) {
test('jwa: rs'+bits+' <-> openssl interop', function (t) {
const input = 'iodine';
const algo = jwa('rs'+bits);
const dgst = spawn('openssl', ['dgst', '-sha'+bits, '-sign', __dirname + '/rsa-private.pem']);
var buffer = Buffer(0);
dgst.stdin.end(input);
dgst.stdout.on('data', function (buf) {
buffer = Buffer.concat([buffer, buf]);
});
dgst.on('exit', function (code) {
if (code !== 0)
return t.fail('could not test interop: openssl failure');
const base64sig = buffer.toString('base64');
const sig = base64url.fromBase64(base64sig);
t.ok(algo.verify(input, sig, rsaPublicKey), 'should verify');
t.notOk(algo.verify(input, sig, rsaWrongPublicKey), 'should not verify');
t.end();
});
});
});
test('ECDSA signing, verifying', function (t) {

@@ -55,0 +77,0 @@ const input = 'kristen schaal';

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