The class used to decrypt or verify a message.
More...
#include <MessageReader.h>
The class used to decrypt or verify a message.
Use it in conjunction with ArmoredInputStream to process armored BaseX input.
◆ MessageReader() [1/4]
saltpack::MessageReader::MessageReader |
( |
std::istream & | is, |
|
|
const BYTE_ARRAY & | recipientSecretkey ) |
Creates a new MessageReader instance to decrypt a message.
- Parameters
-
is | the source input stream containing the encrypted message. |
recipientSecretkey | the private key of the recipient. |
- Exceptions
-
◆ MessageReader() [2/4]
saltpack::MessageReader::MessageReader |
( |
std::istream & | is | ) |
|
|
explicit |
Creates a new MessageReader instance to verify a signed message.
- Parameters
-
is | the source input stream containing the message with its signature attached. |
- Exceptions
-
◆ MessageReader() [3/4]
saltpack::MessageReader::MessageReader |
( |
std::istream & | is, |
|
|
std::istream & | messageStream ) |
Creates a new MessageReader instance to verify a signed message.
- Parameters
-
is | the source input stream containing the detached signature. |
messageStream | the input stream containing the message to verify. |
- Exceptions
-
◆ MessageReader() [4/4]
saltpack::MessageReader::MessageReader |
( |
std::istream & | is, |
|
|
const BYTE_ARRAY & | recipientSecretkey, |
|
|
const std::pair< BYTE_ARRAY, BYTE_ARRAY > & | symmetricKey ) |
Creates a new MessageReader instance to decrypt and verify a signcrypted message.
- Parameters
-
is | the source input stream containing the message. |
recipientSecretkey | the Curve25519 private key of the recipient. The array can be empty. |
symmetricKey | the symmetric key of the recipient: the first array is treated as the identifier, the second as the key itself. The arrays can be empty. |
- Exceptions
-
◆ ~MessageReader()
saltpack::MessageReader::~MessageReader |
( |
| ) |
|
|
override |
Desctructor. Securely deletes the allocated buffers using sodium_memzero
.
◆ getBlock()
Returns the next block of the decrypted/verified message.
- Exceptions
-
- Returns
- the decrypted/verified data.
◆ getRecipients()
std::list< BYTE_ARRAY > saltpack::MessageReader::getRecipients |
( |
| ) |
|
Returns the public keys / identifiers of the recipients if they're visible (see flag visibleRecipients
in MessageWriter).
- Exceptions
-
- Returns
- the recipients if they're visible, an empty list otherwise.
◆ getSender()
Returns the public key of the sender.
- Returns
- the sender's public key.
◆ hasMoreBlocks()
bool saltpack::MessageReader::hasMoreBlocks |
( |
| ) |
|
Helper method to process all the blocks.
- Exceptions
-
- Returns
- true when there are more blocks to read, false otherwise.
◆ isIntentionallyAnonymous()
bool saltpack::MessageReader::isIntentionallyAnonymous |
( |
| ) |
|
Sender's anonimity status (see MessageWriter::MessageWriter(std::ostream &, std::list<BYTE_ARRAY>)).
- Exceptions
-
- Returns
- true if the sender of the message is intentionally anonymous, false otherwise.
The documentation for this class was generated from the following file: