Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
Public Member Functions | Public Attributes | List of all members
WrappingCipherpackListener Class Reference
Inheritance diagram for WrappingCipherpackListener:
Collaboration diagram for WrappingCipherpackListener:

Public Member Functions

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

Public Attributes

CipherpackListenerRef parent
 

Additional Inherited Members

- Public Types inherited from cipherpack::CipherpackListener
enum class  content_type : uint8_t { header = 0 , message = 1 }
 
- Static Public Member Functions inherited from cipherpack::CipherpackListener
static std::string java_class () noexcept
 

Detailed Description

Definition at line 76 of file crypto1.cpp.

Constructor & Destructor Documentation

◆ WrappingCipherpackListener()

WrappingCipherpackListener::WrappingCipherpackListener ( CipherpackListenerRef  parent_)
inline

Definition at line 80 of file crypto1.cpp.

Here is the caller graph for this function:

◆ ~WrappingCipherpackListener()

WrappingCipherpackListener::~WrappingCipherpackListener ( )
overridedefaultnoexcept

Member Function Documentation

◆ notifyError()

void WrappingCipherpackListener::notifyError ( const bool  decrypt_mode,
const PackHeader header,
const std::string &  msg 
)
inlineoverridevirtualnoexcept

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 from cipherpack::CipherpackListener.

Definition at line 83 of file crypto1.cpp.

◆ notifyHeader()

bool WrappingCipherpackListener::notifyHeader ( const bool  decrypt_mode,
const PackHeader header 
)
inlineoverridevirtualnoexcept

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 from cipherpack::CipherpackListener.

Definition at line 87 of file crypto1.cpp.

◆ notifyProgress()

bool WrappingCipherpackListener::notifyProgress ( const bool  decrypt_mode,
const uint64_t  plaintext_size,
const uint64_t  bytes_processed 
)
inlineoverridevirtualnoexcept

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 from cipherpack::CipherpackListener.

Definition at line 91 of file crypto1.cpp.

◆ notifyEnd()

void WrappingCipherpackListener::notifyEnd ( const bool  decrypt_mode,
const PackHeader header 
)
inlineoverridevirtualnoexcept

User notification of successful completion.

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

Reimplemented from cipherpack::CipherpackListener.

Definition at line 95 of file crypto1.cpp.

◆ getSendContent()

bool WrappingCipherpackListener::getSendContent ( const bool  decrypt_mode) const
inlineoverridevirtualnoexcept

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 from cipherpack::CipherpackListener.

Definition at line 99 of file crypto1.cpp.

Here is the caller graph for this function:

◆ contentProcessed()

bool WrappingCipherpackListener::contentProcessed ( const bool  decrypt_mode,
const content_type  ctype,
cipherpack::secure_vector< uint8_t > &  data,
const bool  is_final 
)
inlineoverridevirtualnoexcept

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 from cipherpack::CipherpackListener.

Definition at line 103 of file crypto1.cpp.

Here is the caller graph for this function:

◆ toString()

std::string WrappingCipherpackListener::toString ( ) const
inlineoverridenoexcept

Definition at line 109 of file crypto1.cpp.

Member Data Documentation

◆ parent

CipherpackListenerRef WrappingCipherpackListener::parent

Definition at line 78 of file crypto1.cpp.


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