Class: openpgp_keyring

openpgp_keyring

The class that deals with storage of the keyring. Currently the only option is to use HTML5 local storage.

new openpgp_keyring

Source:
  • openpgp.js, line 12660

Methods

<inner> exportPrivateKey

returns the openpgp_msg_privatekey representation of the private key at private key ring index
Parameters:
Name Type Description
index Integer the index of the private key within the privateKeys array
Source:
  • openpgp.js, line 12876
Returns:
the private key object
Type
openpgp_msg_privatekey

<inner> exportPublicKey

returns the openpgp_msg_privatekey representation of the public key at public key ring index
Parameters:
Name Type Description
index Integer the index of the public key within the publicKeys array
Source:
  • openpgp.js, line 12853
Returns:
the public key object
Type
openpgp_msg_privatekey

<inner> getPrivateKeyForAddress

Searches the keyring for a private key containing the specified email address
Parameters:
Name Type Description
email_address String email address to search for
Source:
  • openpgp.js, line 12757
Returns:
private keys found
Type
Array[openpgp_msg_privatekey

<inner> getPrivateKeyForKeyId

Searches the keyring for private keys having the specified key id
Parameters:
Name Type Description
keyId String 8 bytes as string containing the key id to look for
Source:
  • openpgp.js, line 12799
Returns:
private keys found
Type
Array[openpgp_msg_privatekey]

<inner> getPublicKeyForAddress

searches all public keys in the keyring matching the address or address part of the user ids
Parameters:
Name Type Description
email_address
Source:
  • openpgp.js, line 12729
Returns:
the public keys associated with provided email address.
Type
array[openpgp_msg_publickey]

<inner> getPublicKeysForKeyId

Searches the keyring for public keys having the specified key id
Parameters:
Name Type Description
keyId provided as string of hex number (lowercase)
Source:
  • openpgp.js, line 12785
Returns:
public keys found
Type
Array[openpgp_msg_privatekey]

<inner> hasPrivateKey

Checks if at least one private key is in the keyring
Source:
  • openpgp.js, line 12701
Returns:
True if there are private keys, else false.
Type
boolean

<inner> importPrivateKey

Imports a private key from an exported ascii armored message
Parameters:
Name Type Description
armored_text String PRIVATE KEY BLOCK message to read the private key from
Source:
  • openpgp.js, line 12835
Returns:
nothing
Type
null

<inner> importPublicKey

Imports a public key from an exported ascii armored message
Parameters:
Name Type Description
armored_text String PUBLIC KEY BLOCK message to read the public key from
Source:
  • openpgp.js, line 12822
Returns:
nothing
Type
null

<inner> init

Initialization routine for the keyring. This method reads the keyring from HTML5 local storage and initializes this instance. This method is called by openpgp.init().
Source:
  • openpgp.js, line 12668
Returns:
undefined
Type
null

<inner> removePrivateKey

Removes a private key from the private key keyring at the specified index
Parameters:
Name Type Description
index Integer the index of the private key within the privateKeys array
Source:
  • openpgp.js, line 12886
Returns:
The private key object which has been removed
Type
openpgp_msg_privatekey

<inner> removePublicKey

Removes a public key from the public key keyring at the specified index
Parameters:
Name Type Description
index Integer the index of the public key within the publicKeys array
Source:
  • openpgp.js, line 12864
Returns:
The public key object which has been removed
Type
openpgp_msg_privatekey

<inner> store

Saves the current state of the keyring to HTML5 local storage. The privateKeys array and publicKeys array gets Stringified using JSON
Source:
  • openpgp.js, line 12711
Returns:
undefined
Type
null