ssh-key-to-pem
Convert an ssh key to PEM format
Last updated 10 years ago by dominictarr .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ssh-key-to-pem 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.11.1                                ...           latest (10 years ago)

3 Versions

  • 0.11.1                                ...           10 years ago
  • 0.11.0                                ...           12 years ago
  • 0.10.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 1
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |