Comparing version 0.0.0 to 0.0.1
{ | ||
"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'; |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
15284
7
257
0
120