Class: HKP

HKP(keyServerBaseUrl, config)

This class implements a client for the OpenPGP HTTP Keyserver Protocol (HKP) in order to lookup and upload keys on standard public key servers.

Constructor

new HKP(keyServerBaseUrl, config)

Initialize the HKP client and configure it with the key server url and fetch function.

Parameters:
Name Type Description
keyServerBaseUrl String

(optional) The HKP key server base url including the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to openpgp.config.keyserver (https://keyserver.ubuntu.com)

config Object

(optional) full configuration, defaults to openpgp.config

Source:

Methods

(async) lookup() → {Promise.<String>}

Search for a public key on the key server either by key ID or part of the user ID.

Parameters:
Name Type Description
options.keyId String

The long public key ID.

options.query String

This can be any part of the key user ID such as name or email address.

Source:
Returns:

The ascii armored public key.

Type
Promise.<String>

(async) upload(publicKeyArmored) → {Promise}

Upload a public key to the server.

Parameters:
Name Type Description
publicKeyArmored String

An ascii armored public key to be uploaded.

Source:
Returns:
Type
Promise