Cipherpack v1.3.0-3-ga29431a
A Cryprographic Stream Processor
Loading...
Searching...
No Matches
cipherpack::CipherpackListener Class Reference

Listener for events occurring while processing a cipherpack message via encryptThenSign() and checkSignThenDecrypt(). More...

#include <cipherpack.hpp>

Inheritance diagram for cipherpack::CipherpackListener:
Collaboration diagram for cipherpack::CipherpackListener:

Public Types

enum class  content_type : uint8_t { header = 0 , message = 1 }
 

Public Member Functions

 ~CipherpackListener () noexcept override=default
 
virtual bool contentProcessed (const bool decrypt_mode, const content_type ctype, cipherpack::secure_vector< uint8_t > &data, const bool is_final) noexcept
 User callback to receive the actual processed content, either the generated cipherpack or plaintext content depending on decrypt_mode.
 
std::string get_java_class () const noexcept override
 
virtual bool getSendContent (const bool decrypt_mode) const noexcept
 User provided information whether process shall send the processed content via contentProcessed() or not.
 
virtual void notifyEnd (const bool decrypt_mode, const PackHeader &header) noexcept
 User notification of successful completion.
 
virtual void notifyError (const bool decrypt_mode, const PackHeader &, const std::string &msg) noexcept
 User notification about an error via text message and preliminary PackHeader.
 
virtual bool notifyHeader (const bool decrypt_mode, const PackHeader &header) noexcept
 User notification of preliminary PackHeader w/o optional hash of the plaintext message.
 
virtual bool notifyProgress (const bool decrypt_mode, const uint64_t plaintext_size, const uint64_t bytes_processed) noexcept
 User notification about content streaming progress.
 
bool operator!= (const CipherpackListener &rhs) const noexcept
 
virtual bool operator== (const CipherpackListener &rhs) const noexcept
 Default comparison operator, merely testing for same memory reference.
 
std::string toString () const noexcept override
 

Static Public Member Functions

static std::string java_class () noexcept
 

Detailed Description

Listener for events occurring while processing a cipherpack message via encryptThenSign() and checkSignThenDecrypt().

See also
Cipherpack Overview
Cipherpack Data Stream
Examples
commandline.cpp.

Definition at line 442 of file cipherpack.hpp.

Member Enumeration Documentation

◆ content_type

enum class cipherpack::CipherpackListener::content_type : uint8_t
strong
Enumerator
header 
message 

Definition at line 444 of file cipherpack.hpp.

Constructor & Destructor Documentation

◆ ~CipherpackListener()

cipherpack::CipherpackListener::~CipherpackListener ( )
overridedefaultnoexcept

Member Function Documentation

◆ notifyError()

virtual void cipherpack::CipherpackListener::notifyError ( const bool decrypt_mode,
const PackHeader & ,
const std::string & msg )
inlinevirtualnoexcept

User notification about an error via text message and preliminary PackHeader.

This message will be send without a subsequent notifyHeader() or notifyEnd() to indicate an error and hence aborts processing.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
headerthe preliminary PackHeader
msgthe error message

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 457 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ notifyHeader()

virtual bool cipherpack::CipherpackListener::notifyHeader ( const bool decrypt_mode,
const PackHeader & header )
inlinevirtualnoexcept

User notification of preliminary PackHeader w/o optional hash of the plaintext message.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
headerthe preliminary PackHeader
Returns
true to continue processing (default), false to abort.

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 468 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ notifyProgress()

virtual bool cipherpack::CipherpackListener::notifyProgress ( const bool decrypt_mode,
const uint64_t plaintext_size,
const uint64_t bytes_processed )
inlinevirtualnoexcept

User notification about content streaming progress.

In case contentProcessed() gets called, notifyProgress() is called thereafter.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
plaintext_sizethe plaintext message size, zero if not determined yet
bytes_processedthe number of unencrypted bytes processed
Returns
true to continue processing (default), false to abort.
See also
contentProcessed()

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 485 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ notifyEnd()

virtual void cipherpack::CipherpackListener::notifyEnd ( const bool decrypt_mode,
const PackHeader & header )
inlinevirtualnoexcept

User notification of successful completion.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
headerthe final PackHeader

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 497 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ getSendContent()

virtual bool cipherpack::CipherpackListener::getSendContent ( const bool decrypt_mode) const
inlinevirtualnoexcept

User provided information whether process shall send the processed content via contentProcessed() or not.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
Returns
true if process shall call contentProcessed(), otherwise false (default)
See also
contentProcessed()

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 508 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ contentProcessed()

virtual bool cipherpack::CipherpackListener::contentProcessed ( const bool decrypt_mode,
const content_type ctype,
cipherpack::secure_vector< uint8_t > & data,
const bool is_final )
inlinevirtualnoexcept

User callback to receive the actual processed content, either the generated cipherpack or plaintext content depending on decrypt_mode.

This callback is only enabled if getSendContent() returns true.

In case contentProcessed() gets called, notifyProgress() is called thereafter.

Parameters
decrypt_modetrue if sender is decrypting, otherwise sender is encrypting
ctypecontent_type of passed data. Always content_type::message if decrypt_mode is true.
datathe processed content, either the generated cipherpack or plaintext content depending on decrypt_mode.
is_finaltrue if this is the last content call, otherwise false
Returns
true to continue processing (default), false to abort.
See also
getSendContent()

Reimplemented in JNICipherpackListener, LoggingCipherpackListener, and WrappingCipherpackListener.

Definition at line 527 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ toString()

std::string cipherpack::CipherpackListener::toString ( ) const
inlineoverridenoexcept

Definition at line 537 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ get_java_class()

std::string cipherpack::CipherpackListener::get_java_class ( ) const
inlineoverridenoexcept

Definition at line 539 of file cipherpack.hpp.

◆ java_class()

static std::string cipherpack::CipherpackListener::java_class ( )
inlinestaticnoexcept

Definition at line 542 of file cipherpack.hpp.

Here is the caller graph for this function:

◆ operator==()

virtual bool cipherpack::CipherpackListener::operator== ( const CipherpackListener & rhs) const
inlinevirtualnoexcept

Default comparison operator, merely testing for same memory reference.

Specializations may override.

Definition at line 552 of file cipherpack.hpp.

◆ operator!=()

bool cipherpack::CipherpackListener::operator!= ( const CipherpackListener & rhs) const
inlinenoexcept

Definition at line 555 of file cipherpack.hpp.


The documentation for this class was generated from the following file: