Accepts binary data to return a Base-64 encoded string containing encrypted data.
The data is encrypted using the RSA public key, generated using the generateKeys method.
Name | Description | Type | Use |
---|---|---|---|
message | Binary data to be encrypted, Base-64 encoded. |
string
|
required |
publicKey | A public key, generated using the generateKeys method. |
string
|
required |
callback | Passed to inform of the results of the encryption process. |
object
|
required |
The callback may be structured as follows:
{ onFailure: function(error) { ... }, onSuccess: function(encryptedString) { ... } }
Name | Description | Return type |
---|---|---|
onFailure | Indicates that it was impossible to encrypt the message. | undefined |
onSuccess | Indicates that the encryption process completed. Passes a Base-64 encoded string that contains data encrypted using the RSA public key. | undefined |