1.0.0-alpha.2 • Published 9 years ago

keybase-key-provider v1.0.0-alpha.2

Weekly downloads
-
License
BSD-2-Clause
Repository
gitlab
Last release
9 years ago

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.

1.0.0-alpha.2

9 years ago

1.0.0-alpha.1

9 years ago