The class used to encrypt or sign a message.
More...
#include <MessageWriter.h>
|
| | MessageWriter (std::ostream &os, BYTE_ARRAY senderSecretkey, const std::list< BYTE_ARRAY > &recipients, bool visibleRecipients) |
| |
| | MessageWriter (std::ostream &os, BYTE_ARRAY senderSecretkey, const std::list< BYTE_ARRAY > &recipients) |
| |
| | MessageWriter (std::ostream &os, const std::list< BYTE_ARRAY > &recipients, bool visibleRecipients) |
| |
| | MessageWriter (std::ostream &os, const std::list< BYTE_ARRAY > &recipients) |
| |
| | MessageWriter (std::ostream &os, const BYTE_ARRAY &senderSecretkey, bool detatchedSignature) |
| |
| | MessageWriter (std::ostream &os, const BYTE_ARRAY &senderSecretkey, const std::list< BYTE_ARRAY > &recipientsPublickeys, const std::list< std::pair< BYTE_ARRAY, BYTE_ARRAY > > &symmetricKeys) |
| |
| | MessageWriter (std::ostream &os, const std::list< BYTE_ARRAY > &recipientsPublickeys, const std::list< std::pair< BYTE_ARRAY, BYTE_ARRAY > > &symmetricKeys) |
| |
| | ~MessageWriter () override |
| |
| void | addBlock (BYTE_ARRAY data, bool final) |
| |
The class used to encrypt or sign a message.
Use it in conjunction with ArmoredOutputStream to produce armored BaseX output.
◆ MessageWriter() [1/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
BYTE_ARRAY | senderSecretkey, |
|
|
const std::list< BYTE_ARRAY > & | recipients, |
|
|
bool | visibleRecipients ) |
Creates a new MessageWriter instance to encrypt a message.
- Parameters
-
| os | the destination output stream that will contain the encrypted data. |
| senderSecretkey | the private key of the sender, generated by Utils::generateKeypair(). |
| recipients | the list of public keys of the recipients. |
| visibleRecipients | if true, the public keys of the recipients will be visible in the encrypted message. |
- Exceptions
-
◆ MessageWriter() [2/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
BYTE_ARRAY | senderSecretkey, |
|
|
const std::list< BYTE_ARRAY > & | recipients ) |
Creates a new MessageWriter instance to encrypt a message. The recipients public keys will be visible in the encrypted message.
- Parameters
-
| os | the destination output stream that will contain the encrypted data. |
| senderSecretkey | the private key of the sender, generated by Utils::generateKeypair(). |
| recipients | the list of public keys of the recipients. |
- Exceptions
-
◆ MessageWriter() [3/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
const std::list< BYTE_ARRAY > & | recipients, |
|
|
bool | visibleRecipients ) |
Creates a new MessageWriter instance to encrypt a message remaining anonymous.
- Parameters
-
| os | the destination output stream that will contain the encrypted data. |
| recipients | the list of public keys of the recipients. |
| visibleRecipients | if true, the public keys of the recipients will be visible in the encrypted message. |
- Exceptions
-
◆ MessageWriter() [4/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
const std::list< BYTE_ARRAY > & | recipients ) |
Creates a new MessageWriter instance to encrypt a message remaining anonymous. The recipients public keys will be visible in the encrypted message.
- Parameters
-
| os | the destination output stream that will contain the encrypted data. |
| recipients | the list of public keys of the recipients. |
- Exceptions
-
◆ MessageWriter() [5/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
const BYTE_ARRAY & | senderSecretkey, |
|
|
bool | detatchedSignature ) |
Creates a new MessageWriter instance to sign a message.
- Parameters
-
| os | the destination output stream that will contain the signed data. |
| senderSecretkey | the private key of the sender, generated by Utils::generateSignKeypair(). |
| detatchedSignature | attached/detached signature flag. |
- Exceptions
-
◆ MessageWriter() [6/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
const BYTE_ARRAY & | senderSecretkey, |
|
|
const std::list< BYTE_ARRAY > & | recipientsPublickeys, |
|
|
const std::list< std::pair< BYTE_ARRAY, BYTE_ARRAY > > & | symmetricKeys ) |
Creates a new MessageWriter instance to signcrypt a message.
- Parameters
-
| os | the destination output stream that will contain the signcrypted data. |
| senderSecretkey | the private key of the sender, generated by Utils::generateSignKeypair(). |
| recipientsPublickeys | the list of Curve25519 public keys of the recipients. The list can be empty. |
| symmetricKeys | the list of symmetric keys of the recipients: the first array is treated as the identifier, the second as the key itself. The list can be empty. |
- Exceptions
-
◆ MessageWriter() [7/7]
| saltpack::MessageWriter::MessageWriter |
( |
std::ostream & | os, |
|
|
const std::list< BYTE_ARRAY > & | recipientsPublickeys, |
|
|
const std::list< std::pair< BYTE_ARRAY, BYTE_ARRAY > > & | symmetricKeys ) |
Creates a new MessageWriter instance to signcrypt a message remaining anonymous.
- Parameters
-
| os | the destination output stream that will contain the signcrypted data. |
| recipientsPublickeys | the list of Curve25519 public keys of the recipients. The list can be empty. |
| symmetricKeys | the list of symmetric keys of the recipients: the first array is treated as the identifier, the second as the key itself. The list can be empty. |
- Exceptions
-
◆ ~MessageWriter()
| saltpack::MessageWriter::~MessageWriter |
( |
| ) |
|
|
override |
Desctructor. Securely deletes the allocated buffers using sodium_memzero.
◆ addBlock()
| void saltpack::MessageWriter::addBlock |
( |
BYTE_ARRAY | data, |
|
|
bool | final ) |
Adds a block to the current message.
- Parameters
-
| data | the data for the block, maximum 1MB. |
| final | the flag defining the last packet of the message. |
- Exceptions
-
The documentation for this class was generated from the following file: