Module: message

Requires

Classes

Message

Methods

(static) encryptSessionKey(sessionKey, symAlgo, publicKeys, passwords) → {Message}

Encrypt a session key either with public keys, passwords, or both at once.
Parameters:
Name Type Description
sessionKey Uint8Array session key for encryption
symAlgo String session key algorithm
publicKeys Array.<Key> (optional) public key(s) for message encryption
passwords Array.<String> (optional) for message encryption
Source:
Returns:
new message with encrypted content
Type
Message

(static) fromBinary(bytes, filename) → {module:message~Message}

creates new message object from binary data
Parameters:
Name Type Description
bytes Uint8Array
filename String (optional)
Source:
Returns:
new message object
Type
module:message~Message

(static) fromText(text, filename) → {module:message~Message}

creates new message object from text
Parameters:
Name Type Description
text String
filename String (optional)
Source:
Returns:
new message object
Type
module:message~Message

(static) read(input) → {Message}

reads an OpenPGP message as byte array and returns a message object
Parameters:
Name Type Description
input Uint8Array binary message
Source:
Returns:
new message object
Type
Message

(static) readArmored(armoredText) → {module:message~Message}

reads an OpenPGP armored message and returns a message object
Parameters:
Name Type Description
armoredText String text to be parsed
Source:
Returns:
new message object
Type
module:message~Message

(static) readSignedContent(content, detachedSignature)

Create a message object from signed content and a detached armored signature.
Parameters:
Name Type Description
content String An 8 bit ascii string containing e.g. a MIME subtree with text nodes or attachments
detachedSignature String The detached ascii armored PGP signature
Source:

(inner) createVerificationObjects(signatureList, literalDataList, keys) → {Array.<({keyid: module:type/keyid, valid: Boolean})>}

Create list of objects containing signer's keyid and validity of signature
Parameters:
Name Type Description
signatureList Array.<module:packet/signature> array of signature packets
literalDataList Array.<module:packet/literal> array of literal data packets
keys Array.<module:key~Key> array of keys to verify signatures
Source:
Returns:
list of signer's keyid and validity of signature
Type
Array.<({keyid: module:type/keyid, valid: Boolean})>