Module: encoding/armor

encoding/armor

Requires

Members

<inner> 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> getType(text) → {Integer}

Finds out which Ascii Armoring type is used. This is an internal function
Parameters:
Name Type Description
text String [String] ascii armored text
Source:
Returns:
0 = MESSAGE PART n of m 1 = MESSAGE PART n 2 = SIGNED MESSAGE 3 = PGP MESSAGE 4 = PUBLIC KEY BLOCK 5 = PRIVATE KEY BLOCK null = unknown
Type
Integer

<inner> splitChecksum(text) → {Boolean|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:
Either false in case of an error or an object with attribute "body" containing the body and an attribute "checksum" containing the checksum.
Type
Boolean | Object

<inner> splitHeaders(text) → {Boolean|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:
Either false in case of an error or an object with attribute "headers" containing the headers and and an attribute "body" containing the body.
Type
Boolean | 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