ssh-key-to-pem

0.11.1 • Public • Published

ssh-key-to-pem

convert an ssh key to PEM format.

deprecated! use sshpk instead!

Usage

read a ssh key and convert it to PEM format.

var fs = require('fs');
var sshKeyToPEM = require('ssh-key-to-pem');

var sshKey = fs.readFileSync('./id_rsa.pub', 'ascii')
var key = sshKeyToPEM(sshKey);

console.log(key)

Alternatively, convert a PEM format public key into an ssh-rsa key

var fs = require('fs');
var pemToRsaSSHKey = require('ssh-key-to-pem').pemToRsaSSHKey;

var key = fs.readFileSync('./pub_key.pem', 'ascii')
var sshKey = pemToRsaSSHKey(key);

console.log(sshKey)

Installation

npm install ssh-key-to-pem

License

MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.11.1
    1,062
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.11.1
    1,062
  • 0.11.0
    578
  • 0.10.0
    7

Package Sidebar

Install

npm i ssh-key-to-pem

Weekly Downloads

1,647

Version

0.11.1

License

none

Last publish

Collaborators

  • mcavage