Neovictorian Paisley Menswear
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

hkp-client

0.0.2 • Public • Published

hkp-client

Use this for searching and fetching keys from public-key servers implementing the OpenPGP HTTP Keyserver Protocol (HKP).

Build Status

Search

var hkp = require('hkp-client');
var keyserver = 'http://pgp.mit.edu:11371';
var search = 'torvalds@linux-foundation.org';
hkp.search(keyserver, search, function(err, results) {
  if (err) return console.log(err);
  console.log(results);
});
[ 
  {
    uid: { 
      user: 'Linus Torvalds <torvalds@linux-foundation.org>',
       time: '1316554898' 
    },
    pub: { 
      keyId: '00411886', 
      bits: '2048', 
      time: '1316554898'
    }
  }
]

Fetch

var hkp = require('hkp-client');
var keyserver = 'http://pgp.mit.edu:11371';
var keyId = '00411886';
hkp.fetch(keyserver, keyId, function(err, pubKey) {
  if (err) return console.log(err);
  console.log(pubKey);
});
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.0

...
...

-----END PGP PUBLIC KEY BLOCK-----

Keywords

none

install

npm i hkp-client

Downloadsweekly downloads

2

version

0.0.2

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability