Module: packet/packet

Functions for reading and writing packets

Source:

Methods

(static) readPackets(input, callback) → {Boolean}

Generic static Packet Parser function

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

Input stream as string

callback function

Function to call with the parsed packet

Source:
Returns:

Returns false if the stream was empty and parsing is done, and true otherwise.

Type
Boolean

(static) supportsStreaming(tag) → {Boolean}

Whether the packet type supports partial lengths per RFC4880

Parameters:
Name Type Description
tag Integer

Tag type

Source:
Returns:

String of the header.

Type
Boolean

(static) writeHeader(tag_type, length) → {String}

Writes a packet header version 4 with the given tag_type and length to a string

Parameters:
Name Type Description
tag_type Integer

Tag type

length Integer

Length of the payload

Source:
Returns:

String of the header.

Type
String

(static) writeSimpleLength(length) → {Uint8Array}

Encodes a given integer of length to the openpgp length specifier to a string

Parameters:
Name Type Description
length Integer

The length to encode

Source:
Returns:

String with openpgp length representation.

Type
Uint8Array