Class: PacketList

PacketList()

This class represents a list of openpgp packets. Take care when iterating over it - the packets themselves are stored as numerical indices.

Constructor

new PacketList()

Source:

Extends

  • Array

Methods

concat()

Concatenates packetlist or array of packets

Source:

filterByTag()

Creates a new PacketList with all packets from the given types

Source:

findPacket(type) → {Packet|undefined}

Traverses packet tree and returns first matching packet

Parameters:
Name Type Description
type module:enums.packet

The packet type

Source:
Returns:
Type
Packet | undefined

indexOfTag()

Returns array of found indices by tag

Source:

push(packet)

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.

Parameters:
Name Type Description
packet Object

Packet to push

Source:

(async) read(bytes)

Reads a stream of binary data and interprets it as a list of packets.

Parameters:
Name Type Description
bytes Uint8Array | ReadableStream.<Uint8Array>

A Uint8Array of bytes.

Source:

write() → {Uint8Array}

Creates a binary representation of openpgp objects contained within the class instance.

Source:
Returns:

A Uint8Array containing valid openpgp packets.

Type
Uint8Array