All Projects → dominictarr → ssh-key-to-pem

dominictarr / ssh-key-to-pem

Licence: MIT License
No description, website, or topics provided.

Programming Languages

javascript
184084 projects - #8 most used programming language
emacs lisp
2029 projects

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].