Class: openpgp_packet_signature

openpgp_packet_signature

Implementation of the Signature Packet (Tag 2) RFC4480 5.2: A Signature packet describes a binding between some public key and some data. The most common signatures are a signature of a file or a block of text, and a signature that is a certification of a User ID.

new openpgp_packet_signature()

Source:

Methods

<inner> getIssuer() → {String}

gets the issuer key id of this signature
Source:
Returns:
issuer key id as string (8bytes)
Type
String

<inner> getIssuerKey() → {Object}

Tries to get the corresponding public key out of the public keyring for the issuer created this signature
Source:
Returns:
{obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise
Type
Object

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

parsing function for a signature packet (tag 2).
Parameters:
Name Type Description
input String payload of a tag 2 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

<inner> toString() → {String}

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

<inner> verify(data, key) → {boolean}

verifys the signature packet. Note: not signature types are implemented
Parameters:
Name Type Description
data String data which on the signature applies
key openpgp_msg_privatekey the public key to verify the signature
Source:
Returns:
True if message is verified, else false.
Type
boolean

<inner> write_message_signature(signature_type, data, privatekey) → {String}

creates a string representation of a message signature packet (tag 2). This can be only used on text data
Parameters:
Name Type Description
signature_type Integer should be 1 (one)
data String data to be signed
privatekey openpgp_msg_privatekey private key used to sign the message. (secMPIs MUST be unlocked)
Source:
Returns:
string representation of a signature packet
Type
String

<inner> write_sub_signature_packet(type, data) → {String}

creates a string representation of a sub signature packet (See RFC 4880 5.2.3.1)
Parameters:
Name Type Description
type Integer subpacket signature type. Signature types as described in RFC4880 Section 5.2.3.2
data String data to be included
Source:
Returns:
a string-representation of a sub signature packet (See RFC 4880 5.2.3.1)
Type
String