New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rsa-unpack

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rsa-unpack - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/data/expected3.json

3

example/pair.js
var fs = require('fs');
var keys = require('./keys.json');
var path = require('path');
var keys = require(path.resolve(process.argv[2]));

@@ -4,0 +5,0 @@ var unpack = require('../');

var fs = require('fs');
var keys = require('./keys.json');
var path = require('path');
var keys = require(path.resolve(process.argv[2] || 'keys.json'));

@@ -4,0 +5,0 @@ var unpack = require('../');

@@ -15,4 +15,4 @@ module.exports = function (pem) {

var offset = {
private : 7,
public : 3,
private : buf[1] - 0x80 + 5,
public : buf[1] - 0x80 + 2,
}[type];

@@ -24,4 +24,7 @@

if (s & 0x80) {
offset ++;
s = buf.readUInt8(offset + 1);
var n = s - 0x80;
s = buf[[
'readUInt8', 'readUInt16BE'
][n - 1]](offset + 2);
offset += n;
}

@@ -28,0 +31,0 @@

{
"name" : "rsa-unpack",
"version" : "0.0.2",
"version" : "0.0.3",
"description" : "unpack rsa fields from PEM strings",

@@ -5,0 +5,0 @@ "main" : "index.js",

@@ -6,2 +6,3 @@ var test = require('tap').test;

require('./data/expected2.json'),
require('./data/expected3.json'),
];

@@ -12,2 +13,3 @@ var keys = [

require('./data/keys2.json'),
require('./data/keys3.json'),
];

@@ -17,3 +19,3 @@ var unpack = require('../');

test('output matches openssl rsa -text', function (t) {
t.plan(12);
t.plan(keys.length * 4);

@@ -20,0 +22,0 @@ keys.forEach(function (key, ix) {

Sorry, the diff of this file is not supported yet

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