Module: openpgp

openpgp

Source:

Requires

Members

<static> armor

Source:
See:

<static> cleartext

Source:
See:

<static> config

Source:
See:

<static> crypto

Source:
See:

<static> enums

Source:
See:

<static> key

Source:
See:

<static> Keyid

Source:
See:

<static> Keyring

Source:
See:

<static> message

Source:
See:

<static> MPI

Source:
See:

<static> packet

Source:
See:

<static> S2K

Source:
See:

<static> util

Source:
See:

Methods

<static> decryptAndVerifyMessage(privateKey, publicKeys, msg, callback) → {Object}

Decrypts message and verifies signatures
Parameters:
Name Type Description
privateKey module:key~Key private key with decrypted secret key data
publicKeys Array.<module:key~Key> public keys to verify signatures
msg module:message~Message the message object with signed and encrypted data
callback function (optional) callback(error, result) for async style
Source:
Returns:
decrypted message as as native JavaScript string with verified signatures or null if no literal data found
Type
Object

<static> decryptMessage(privateKey, msg, callback) → {String|null}

Decrypts message
Parameters:
Name Type Description
privateKey module:key~Key private key with decrypted secret key data
msg module:message~Message the message object with the encrypted data
callback function (optional) callback(error, result) for async style
Source:
Returns:
decrypted message as as native JavaScript string or null if no literal data found
Type
String | null

<static> encryptMessage(keys, text, callback) → {String}

Encrypts message text with keys
Parameters:
Name Type Description
keys Array.<module:key~Key> array of keys, used to encrypt the message
text String message as native JavaScript string
callback function (optional) callback(error, result) for async style
Source:
Returns:
encrypted ASCII armored message
Type
String

<static> generateKeyPair(keyType, numBits, userId, passphrase, callback) → {Object}

Generates a new OpenPGP key pair. Currently only supports RSA keys. Primary and subkey will be of same type.
Parameters:
Name Type Description
keyType module:enums.publicKey to indicate what type of key to make. RSA is 1. See http://tools.ietf.org/html/rfc4880#section-9.1
numBits Integer number of bits for the key creation. (should be 1024+, generally)
userId String assumes already in form of "User Name "
passphrase String The passphrase used to encrypt the resulting private key
callback function (optional) callback(error, result) for async style
Source:
Returns:
{key: Array, privateKeyArmored: Array, publicKeyArmored: Array}
Type
Object

<static> signAndEncryptMessage(publicKeys, privateKey, text, callback) → {String}

Signs message text and encrypts it
Parameters:
Name Type Description
publicKeys Array.<module:key~Key> array of keys, used to encrypt the message
privateKey module:key~Key private key with decrypted secret key data for signing
text String message as native JavaScript string
callback function (optional) callback(error, result) for async style
Source:
Returns:
encrypted ASCII armored message
Type
String

<static> signClearMessage(privateKeys, text, callback) → {String}

Signs a cleartext message
Parameters:
Name Type Description
privateKeys Array.<module:key~Key> private key with decrypted secret key data to sign cleartext
text String cleartext
callback function (optional) callback(error, result) for async style
Source:
Returns:
ASCII armored message
Type
String

<static> verifyClearSignedMessage(publicKeys, msg, callback) → {Object}

Verifies signatures of cleartext signed message
Parameters:
Name Type Description
publicKeys Array.<module:key~Key> public keys to verify signatures
msg module:cleartext~CleartextMessage cleartext message object with signatures
callback function (optional) callback(error, result) for async style
Source:
Returns:
cleartext with status of verified signatures
Type
Object

<inner> execute()

Command pattern that handles async calls gracefully
Source:

<inner> initWorker(path)

Set the path for the web worker script and create an instance of the async proxy
Parameters:
Name Type Description
path String relative path to the worker scripts
Source:

<inner> useWorker()

Are we in a browser and do we support worker?
Source: