Class: Keyring

keyring/keyring~Keyring(storeHandleropt)

new Keyring(storeHandleropt)

Initialization routine for the keyring.

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

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

Source:

Methods

clear()

Clear the keyring - erase all the keys

Source:

getAllKeys() → {Array.<module:key.Key>}

Get all public and private keys

Source:
Returns:

all keys

Type
Array.<module:key.Key>

getKeysForId(keyId, deep) → {Array.<module:key.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.<module:key.Key> | null

(async) load()

Calls the storeHandler to load the keys

Source:

removeKeysForId(keyId) → {Array.<module:key.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.<module:key.Key> | null

(async) store()

Calls the storeHandler to save the keys

Source: