Class: openpgp_packet_keymaterial

openpgp_packet_keymaterial

Implementation of the Key Material Packet (Tag 5,6,7,14) RFC4480 5.5: A key material packet contains all the information about a public or private key. There are four variants of this packet type, and two major versions. Consequently, this section is complex.

new openpgp_packet_keymaterial

Source:
  • openpgp.js, line 2683

Methods

<inner> decryptSecretMPIs

Decrypts the private key MPIs which are needed to use the key. openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be false otherwise a call to this function is not needed
Parameters:
Name Type Description
str_passphrase the passphrase for this private key as string
Source:
  • openpgp.js, line 3024
Returns:
true if the passphrase was correct; false if not

<inner> getFingerprint

calculates the fingerprint of the key
Source:
  • openpgp.js, line 3334
Returns:
a string containing the fingerprint
Type
String

<inner> getKeyId

calculates the key id of they key
Source:
  • openpgp.js, line 3319
Returns:
a 8 byte key id
Type
String

<inner> read_nodes

Continue parsing packets belonging to the key material such as signatures
Parameters:
Name Type Description
parent_node openpgp_* the parent object
input String input string to read the packet(s) from
position integer start position for the parser
len integer length of the packet(s) or remaining length of input
Source:
  • openpgp.js, line 3211
Returns:
length of nodes read
Type
integer

<inner> read_priv_key

Internal parser for private keys as specified in RFC 4880 section 5.5.3
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2890
Returns:
this object with attributes set by the parser

<inner> read_pub_key

Internal Parser for public keys as specified in RFC 4880 section 5.5.2 Public-Key Packet Formats called by read_tag<num>
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2780
Returns:
this object with attributes set by the parser

<inner> read_tag14

This function reads the payload of a public key sub packet (Tag 14) and initializes the openpgp_packet_keymaterial
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2763
Returns:
openpgp_packet_keymaterial object

<inner> read_tag5

This function reads the payload of a secret key packet (Tag 5) and initializes the openpgp_packet_keymaterial
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2714
Returns:
openpgp_packet_keymaterial object

<inner> read_tag6

This function reads the payload of a public key packet (Tag 6) and initializes the openpgp_packet_keymaterial
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2729
Returns:
openpgp_packet_keymaterial object

<inner> read_tag7

This function reads the payload of a secret key sub packet (Tag 7) and initializes the openpgp_packet_keymaterial
Parameters:
Name Type Description
input input string to read the packet from
position start position for the parser
len length of the packet or remaining length of input
Source:
  • openpgp.js, line 2748
Returns:
openpgp_packet_keymaterial object

<inner> toString

Generates Debug output
Source:
  • openpgp.js, line 3138
Returns:
String which gives some information about the keymaterial

<inner> verifyKey

Checks the validity for usage of this (sub)key
Source:
  • openpgp.js, line 3288
Returns:
0 = bad key, 1 = expired, 2 = revoked, 3 = valid