This class represents a list of openpgp packets.
Take care when iterating over it - the packets themselves
are stored as numerical indices.
new (require("packet/packetlist"))()
- Source:
- Source:
Requires
Members
-
<readonly> length :Integer
-
The number of packets contained within the list.
Type:
- Integer
- Source:
Methods
-
concat()
-
Concatenates packetlist or array of packets
- Source:
-
filter()
-
Creates a new packetList with all packets that pass the test implemented by the provided function.
- Source:
-
filterByTag()
-
Creates a new packetList with all packets from the given types
- Source:
-
findPacket(type) → {module:packet/packet|null}
-
Traverses packet tree and returns first matching packet
Parameters:
Name Type Description type
module:enums.packet The packet type - Source:
Returns:
- Type
- module:packet/packet | null
-
forEach()
-
Executes the provided callback once for each element
- Source:
-
indexOfTag()
-
Returns array of found indices by tag
- Source:
-
push()
-
Adds a packet to the list. This is the only supported method of doing so; writing to packetlist[i] directly will result in an error.
- Source:
-
read(A)
-
Reads a stream of binary data and interprents it as a list of packets.
Parameters:
Name Type Description A
String binary string of bytes. - Source:
-
slice()
-
Returns slice of packetlist
- Source:
-
write() → {String}
-
Creates a binary representation of openpgp objects contained within the class instance.
- Source:
Returns:
A binary string of bytes containing valid openpgp packets.- Type
- String