node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


ssh-keychain is a RSA vault you can add, list and remove keys from.

Build Status Coverage Status Version License

This module is designed as a backend for ssh-agent-js, a nodejs SSH agent.


const KeyChain = require('ssh-keychain');
var vault = new KeyChain(); //new empty vault
vault.add_key( fs.readFileSync('some/rsa/key.pem', 'utf-8), 'mykeycomment');
// vault.keys//list current keys in vault
vault.sign("mykeycomment" //or key fingerprint, new Buffer("SomePpayload to sign"));

add_key(PEM encoded key or binary DER [, optionnal key name])

Add a key in the vault, with an optionnal key name.

sign(fingerprint or key name, payload)

Sign the payload with the desired key

remove_key(fingerprint or key name)

Remove the key from by its fingerprint (or key name) from the vault


Remove all keys from the vault


  • 131 author
  • node-rsa