Class: KeyArray

KeyArray(keys)

Array of keys

Constructor

new KeyArray(keys)

Parameters:
Name Type Description
keys Array.<Key>

The keys to store in this array

Source:

Methods

getForAddress(email) → {Array.<Key>}

Searches all keys in the KeyArray matching the address or address part of the user ids

Parameters:
Name Type Description
email String

email address to search for

Source:
Returns:

The public keys associated with provided email address.

Type
Array.<Key>

getForId(keyId, deep) → {Key|null}

Searches the KeyArray for a key 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:

key found or null

Type
Key | null

(async) importKey(armored, config)

Imports a key from an ascii armored message

Parameters:
Name Type Description
armored String

message to read the keys/key from

config Object

(optional) full configuration, defaults to openpgp.config

Source:

push(key) → {Number}

Add key to KeyArray

Parameters:
Name Type Description
key Key

The key that will be added to the keyring

Source:
Returns:

The new length of the KeyArray

Type
Number

removeForId(keyId) → {Key|null}

Removes a key with the specified keyid 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:

The key object which has been removed or null

Type
Key | null