Class: openpgp_packet_userid

openpgp_packet_userid

Implementation of the User ID Packet (Tag 13) A User ID packet consists of UTF-8 text that is intended to represent the name and email address of the key holder. By convention, it includes an RFC 2822 [RFC2822] mail name-addr, but there are no restrictions on its content. The packet length in the header specifies the length of the User ID.

new openpgp_packet_userid()

Source:

Methods

get_text_bytes() → {String}

Get the byte sequence representing the text of this packet.
Source:
Returns:
A sequence of bytes
Type
String

hasCertificationRevocationSignature(keyId)

lookup function to find certification revocation signatures
Parameters:
Name Type Description
keyId String string containing the key id of the issuer of this signature
Source:
Returns:
a CertificationRevocationSignature if found; otherwise null

read_nodes(parent_node, input, position, len) → {Integer}

Continue parsing packets belonging to the userid packet such as signatures
Parameters:
Name Type Description
parent_node Object 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:
Returns:
length of nodes read
Type
Integer

read_packet(input, position, len) → {openpgp_packet_encrypteddata}

Parsing function for a user id packet (tag 13).
Parameters:
Name Type Description
input String payload of a tag 13 packet
position Integer position to start reading from the input string
len Integer length of the packet or the remaining length of input at position
Source:
Returns:
object representation
Type
openpgp_packet_encrypteddata

set_text(str)

Set the packet text field to a native javascript string Conversion to a proper utf8 encoding takes place when the packet is written.
Parameters:
Name Type Description
str String Any native javascript string
Source:

set_text_bytes(bytes)

Set the packet text to value represented by the provided string of bytes.
Parameters:
Name Type Description
bytes String A string of bytes
Source:

toString() → {String}

generates debug output (pretty print)
Source:
Returns:
String which gives some information about the user id packet
Type
String

verify()

verifies the signatures of the user id
Source:
Returns:
0 if the userid is valid; 1 = userid expired; 2 = userid revoked

verifyCertificationSignatures(publicKeyPacket) → {Integer[]}

Verifies all certification signatures. This method does not consider possible revocation signatures.
Parameters:
Name Type Description
publicKeyPacket Object the top level key material
Source:
Returns:
An array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: 0 = bad signature 1 = signature expired 2 = issuer key not available 3 = revoked 4 = signature valid 5 = signature by key owner expired 6 = signature by key owner revoked
Type
Integer[]

write_packet(user_id) → {String}

Creates a string representation of the user id packet
Parameters:
Name Type Description
user_id String the user id as string ("John Doe
Source:
Returns:
string representation
Type
String