Class: Keyring

Keyring(storeHandleropt, config)

new Keyring(storeHandleropt, config)

Initialization routine for the keyring.

Parameters:
Name Type Attributes Description
storeHandler keyring/localstore <optional>

class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods

config Object

(optional) full configuration, defaults to openpgp.config

Source:

Methods

clear()

Clear the keyring - erase all the keys

Source:

getAllKeys() → {Array.<Key>}

Get all public and private keys

Source:
Returns:

all keys

Type
Array.<Key>

getKeysForId(keyId, deep) → {Array.<Key>|null}

Searches the keyring for keys having the specified key id

Parameters:
Name Type Description
keyId String

provided as string of lowercase hex number withouth 0x prefix (can be 16-character key ID or fingerprint)

deep Boolean

if true search also in subkeys

Source:
Returns:

keys found or null

Type
Array.<Key> | null

(async) load()

Calls the storeHandler to load the keys

Source:

removeKeysForId(keyId) → {Array.<Key>|null}

Removes keys having the specified key id from the keyring

Parameters:
Name Type Description
keyId String

provided as string of lowercase hex number withouth 0x prefix (can be 16-character key ID or fingerprint)

Source:
Returns:

keys found or null

Type
Array.<Key> | null

(async) store()

Calls the storeHandler to save the keys

Source: