Add HKP lookup example to README
This commit is contained in:
parent
f46696a915
commit
bcde9bfa1a
12
README.md
12
README.md
|
@ -55,6 +55,18 @@ openpgp.generateKeyPair(options).then(function(keypair) {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Public key lookup on HKP server
|
||||||
|
```js
|
||||||
|
var openpgp = require('openpgp');
|
||||||
|
var hkp = new openpgp.HKP('https://pgp.mit.edu');
|
||||||
|
|
||||||
|
hkp.lookup({
|
||||||
|
query: 'alice@example.com'
|
||||||
|
}).then(function(key) {
|
||||||
|
var publicKey = openpgp.key.readArmored(key);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
#### Encryption
|
#### Encryption
|
||||||
```js
|
```js
|
||||||
var openpgp = require('openpgp');
|
var openpgp = require('openpgp');
|
||||||
|
|
|
@ -44,8 +44,8 @@ function HKP(keyServerBaseUrl, fetch) {
|
||||||
/**
|
/**
|
||||||
* Search for a public key on the key server either by key ID or part of the user ID.
|
* Search for a public key on the key server either by key ID or part of the user ID.
|
||||||
* @param {String} options.keyID The long public key ID.
|
* @param {String} options.keyID The long public key ID.
|
||||||
* @param {String} options.query This can be any part of the key user ID such as name.
|
* @param {String} options.query This can be any part of the key user ID such as name
|
||||||
* or email address
|
* or email address.
|
||||||
* @return {Promise<String>} The ascii armored public key.
|
* @return {Promise<String>} The ascii armored public key.
|
||||||
*/
|
*/
|
||||||
HKP.prototype.lookup = function(options) {
|
HKP.prototype.lookup = function(options) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user