new AsyncProxy(path)
Initializes a new proxy and loads the web worker
Parameters:
| Name | Type | Description |
|---|---|---|
path |
String | The path to the worker or 'openpgp.worker.js' by default |
- Source:
Methods
-
decryptAndVerifyMessage(privateKey, publicKeys, message, callback)
-
Decrypts message and verifies signatures
Parameters:
Name Type Description privateKeymodule:key~Key private key with decrypted secret key data publicKeysArray.<module:key~Key> public keys to verify signatures messagemodule:message~Message the message object with signed and encrypted data callbackfunction receives decrypted message as as native JavaScript string with verified signatures or null if no literal data found - Source:
-
decryptKey(privateKey, password, callback)
-
Decrypts secret part of all secret key packets of key.
Parameters:
Name Type Description privateKeymodule:key~Key private key with encrypted secret key data passwordString password to unlock the key callbackfunction receives decrypted key - Source:
-
decryptKeyPacket(privateKey, keyIds, password, callback)
-
Decrypts secret part of key packets matching array of keyids.
Parameters:
Name Type Description privateKeymodule:key~Key private key with encrypted secret key data keyIdsArray.<module:type/keyid> passwordString password to unlock the key callbackfunction receives decrypted key - Source:
-
decryptMessage(privateKey, message, callback)
-
Decrypts message
Parameters:
Name Type Description privateKeymodule:key~Key private key with decrypted secret key data messagemodule:message~Message the message object with the encrypted data callbackfunction receives decrypted message as as native JavaScript string or null if no literal data found - Source:
-
encryptMessage(keys, text, callback)
-
Encrypts message text with keys
Parameters:
Name Type Description keysArray.<module:key~Key> array of keys, used to encrypt the message textString message as native JavaScript string callbackfunction receives encrypted ASCII armored message - Source:
-
generateKeyPair(keyType, numBits, userId, passphrase, callback)
-
Generates a new OpenPGP key pair. Currently only supports RSA keys. Primary and subkey will be of same type.
Parameters:
Name Type Description keyTypemodule:enums.publicKey to indicate what type of key to make. RSA is 1. See http://tools.ietf.org/html/rfc4880#section-9.1 numBitsInteger number of bits for the key creation. (should be 1024+, generally) userIdString assumes already in form of "User Name " passphraseString The passphrase used to encrypt the resulting private key callbackfunction receives object with key and public and private armored texts - Source:
-
getRandomBuffer(size) → {Uint8Array}
-
Get Uint8Array with random numbers
Parameters:
Name Type Description sizeInteger Length of buffer - Source:
Returns:
- Type
- Uint8Array
-
onMessage()
-
Message handling
- Source:
-
seedRandom(size)
-
Send message to worker with random data
Parameters:
Name Type Description sizeInteger Number of bytes to send - Source:
-
signAndEncryptMessage(publicKeys, privateKey, text, callback)
-
Signs message text and encrypts it
Parameters:
Name Type Description publicKeysArray.<module:key~Key> array of keys, used to encrypt the message privateKeymodule:key~Key private key with decrypted secret key data for signing textString message as native JavaScript string callbackfunction receives encrypted ASCII armored message - Source:
-
signClearMessage(privateKeys, text, callback)
-
Signs a cleartext message
Parameters:
Name Type Description privateKeysArray.<module:key~Key> private key with decrypted secret key data to sign cleartext textString cleartext callbackfunction receives ASCII armored message - Source:
-
terminate()
-
Terminates the worker
- Source:
-
verifyClearSignedMessage(publicKeys, message, callback)
-
Verifies signatures of cleartext signed message
Parameters:
Name Type Description publicKeysArray.<module:key~Key> public keys to verify signatures messagemodule:cleartext~CleartextMessage cleartext message object with signatures callbackfunction receives cleartext with status of verified signatures - Source: