Module: packet/signature

packet/signature

new require("packet/signature")()

Source:
Source:

Methods

isExpired() → {Boolean}

Verifies signature expiration date
Source:
Returns:
true if expired
Type
Boolean

read(bytes, position, len) → {module:packet/encrypteddata}

parsing function for a signature packet (tag 2).
Parameters:
Name Type Description
bytes String payload of a tag 2 packet
position Integer position to start reading from the bytes string
len Integer length of the packet or the remaining length of bytes at position
Source:
Returns:
object representation
Type
module:packet/encrypteddata

sign(data, privatekey)

Signs provided data. This needs to be done prior to serialization.
Parameters:
Name Type Description
data Object Contains packets to be signed.
privatekey module:key private key used to sign the message.
Source:

verify(data, key) → {boolean}

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

write_all_sub_packets() → {String}

Creates string of bytes with all subpacket data
Source:
Returns:
a string-representation of a all subpacket data
Type
String

<inner> write_sub_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