Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 25, 2024 via pnpm

sshpk 1.17.0

A library for finding and using SSH public keys
Package summary
Share
0
issues
3
licenses
8
MIT
1
BSD-3-Clause
1
Unlicense
Package created
19 Sep 2015
Version published
7 Jan 2022
Maintainers
8
Total deps
10
Direct deps
9
License
MIT

Issues

0
This package has no issues

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
8 Packages, Including:
asn1@0.2.6
assert-plus@1.0.0
dashdash@1.14.1
ecc-jsbn@0.1.2
getpass@0.1.7
jsbn@0.1.1
safer-buffer@2.1.2
sshpk@1.17.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
bcrypt-pbkdf@1.0.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

9
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-plus1.0.03.85 kBMIT
prod
bcrypt-pbkdf1.0.210.85 kBBSD-3-Clause
prod
dashdash1.14.122.99 kBMIT
prod
ecc-jsbn0.1.27.91 kBMIT
prod
getpass0.1.72.54 kBMIT
prod
jsbn0.1.113.39 kBMIT
prod
safer-buffer2.1.211.75 kBMIT
prod
tweetnacl0.14.548.5 kBUnlicense
prod

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.