Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 22, 2024 via pnpm

sshpk 1.7.2

A library for finding and using SSH public keys
Package summary
Share
2
issues
2
high severity
vulnerability
2
2
licenses
9
MIT
1
Unlicense
Package created
19 Sep 2015
Version published
6 Jan 2016
Maintainers
8
Total deps
10
Direct deps
7
License
MIT

Issues

2

2 high severity issues

high
Recommendation: Upgrade to version 1.13.2 or later
via: sshpk@1.7.2
Recommendation: Upgrade to version 1.13.2 or later
via: sshpk@1.7.2
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
9 Packages, Including:
asn1@0.2.6
assert-plus@0.2.0
assert-plus@1.0.0
dashdash@1.14.1
ecc-jsbn@0.2.0
jodid25519@1.0.2
jsbn@0.1.1
safer-buffer@2.1.2
sshpk@1.7.2

The Unlicense

Public Domain
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
private-use
modify
Cannot
include-copyright
hold-liable
Must
1 Packages, Including:
tweetnacl@0.14.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

7
All Dependencies CSV
β“˜ This is a list of sshpk 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
asn10.2.65.84 kBMIT
prod
assert-plus0.2.03.72 kBMIT
prod
dashdash1.14.122.99 kBMIT
prod
ecc-jsbn0.2.07.99 kBMIT
prod optional
jodid255191.0.213.49 kBMIT
prod optional
jsbn0.1.113.39 kBMIT
prod optional
tweetnacl0.14.548.5 kBUnlicense
prod optional

Visualizations

Frequently Asked Questions

What does sshpk do?

SSHpk is an npm package that provides functionality to parse, convert, fingerprint, and utilize SSH keys in node.js, without the need for ssh-keygen or other external dependencies. The library supports RSA, DSA, ECDSA (nistp-*) and ED25519 key types, in both PEM (PKCS#1, PKCS#8) and OpenSSH formats.

How do you use sshpk?

To utilize SSHpk, one needs to first install it using the command npm install sshpk. Once installed, you can use it in your code. Here are a few examples of how to use SSHpk:

  1. Reading an OpenSSH-format public key:
var sshpk = require('sshpk');
var fs = require('fs');

var keyPub = fs.readFileSync('id_rsa.pub');
var key = sshpk.parseKey(keyPub, 'ssh');

console.log('Type =>', key.type);
console.log('Size =>', key.size);
console.log('Comment =>', key.comment);
  1. Using a PEM public key:
var sshpk = require('sshpk');
var fs = require('fs');

var keyPem = fs.readFileSync('id_rsa.pem');
var key = sshpk.parseKey(keyPem, 'pem');
  1. Signing and verifying data using a private key:
var sshpk = require('sshpk');
var fs = require('fs');

var keyPriv = fs.readFileSync('id_ecdsa');
var key = sshpk.parsePrivateKey(keyPriv, 'pem');

var data = 'some data';

var s = key.createSign('sha1');
s.update(data);
var signature = s.sign();

You'll notice that all examples begin with requiring both the sshpk and the fs modules. The fs means file system, and it's what allows us to read the key files. Using the sshpk.parseKey method, we can parse the key file and examine its details or use it for signing data.

Where are the sshpk docs?

The complete documentation for sshpk library can be found directly in the README file on the GitHub repository, at https://github.com/joyent/node-sshpk. The documentation provides in-depth information about the different methods, properties, and options available with sshpk. You will find detailed examples and explanations for using this library effectively.