keybase-key-provider
v1.0.0-alpha.2
Published
A KeyProvider for Node Password Store that will fetch a private key from Keybase.io
Downloads
3
Readme
Keybase KeyProvider
A KeyProvider for Node Password Store that will fetch a private key from Keybase.
This is a separate module because the Keybase API is currently in alpha.
Installation
npm install keybase-key-provider
Usage
Initialization
const KeybaseKeyProvider = require("keybase-key-provider")
/* Pass the user's Keybase credentials into the KeyProvider constructor. */
const keyProvider = new KeybaseKeyProvider(email_or_username, passphrase)
Use with Node Password Store
/* This can be passed into the Node Password Store constructor. */
const Pass = require("password-store")
const pass = new Pass(keyProvider.keyFetcher)
Use with kbpgp.js
/*
* Like other KeyProviders, a `keyFetcher` property is present.
* This property is a promise that resolves with a `kbpgp.KeyFetcher` object.
* We can use this with `kbpgp` to encrypt/decrypt data.
*/
const kbpgp = require("kbpgp")
keyProvider.keyFetcher.then(function(keyFetcher) {
kbpgp.box(
{encrypt_for: keyFetcher, msg: "Secret Squirrel"},
function(err, result) {
console.log(err, result)
}
)
})
License
Keybase KeyProvider is licensed under the BSD 2-Clause License.