keybase-key-provider

1.0.0-alpha.2 • Public • Published

Keybase KeyProvider Build Status Known Vulnerabilities codecov

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.

Readme

Keywords

none

Package Sidebar

Install

npm i keybase-key-provider

Weekly Downloads

1

Version

1.0.0-alpha.2

License

BSD-2-Clause

Last publish

Collaborators

  • billtron