Module: encoding/armor

Requires

Members

(inner, constant) crc_table

Internal function to calculate a CRC-24 checksum over a given string (data)

Source:

Methods

(static) armor(messagetype, body, partindex, parttotal) → {String}

Armor an OpenPGP binary packet block

Parameters:
Name Type Description
messagetype Integer

type of the message

body
partindex Integer
parttotal Integer
Source:
Returns:

Armored text

Type
String

(static) dearmor(text) → {Object}

DeArmor an OpenPGP armored message; verify the checksum and return the encoded bytes

Parameters:
Name Type Description
text String

OpenPGP armored message

Source:
Returns:

An object with attribute "text" containing the message text, an attribute "data" containing the bytes and "type" for the ASCII armor type

Type
Object

(inner) addheader() → {String}

Add additional information to the armor version of an OpenPGP binary packet block.

Version:
  • 2011-12-16
Author:
  • Alex
Source:
Returns:

The header information

Type
String

(inner) getCheckSum(data) → {String}

Calculates a checksum over the given data and returns it base64 encoded

Parameters:
Name Type Description
data String

Data to create a CRC-24 checksum for

Source:
Returns:

Base64 encoded checksum

Type
String

(inner) splitChecksum(text) → {Object}

Splits a message into two parts, the body and the checksum. This is an internal function

Parameters:
Name Type Description
text String

OpenPGP armored message part

Source:
Returns:

An object with attribute "body" containing the body and an attribute "checksum" containing the checksum.

Type
Object

(inner) splitHeaders(text) → {Object}

Splits a message into two parts, the headers and the body. This is an internal function

Parameters:
Name Type Description
text String

OpenPGP armored message part

Source:
Returns:

An object with attribute "headers" containing the headers and an attribute "body" containing the body.

Type
Object

(inner) verifyCheckSum(data, checksum) → {Boolean}

Calculates the checksum over the given data and compares it with the given base64 encoded checksum

Parameters:
Name Type Description
data String

Data to create a CRC-24 checksum for

checksum String

Base64 encoded checksum

Source:
Returns:

True if the given checksum is correct; otherwise false

Type
Boolean