pulsar-client-cpp
Loading...
Searching...
No Matches
pulsar::EncryptionContext Class Reference

#include <EncryptionContext.h>

Public Types

using KeysType = std::vector<EncryptionKey>

Public Member Functions

const KeysType & keys () const noexcept
const std::string & param () const noexcept
const std::string & algorithm () const noexcept
CompressionType compressionType () const noexcept
uint32_t uncompressedMessageSize () const noexcept
int32_t batchSize () const noexcept
bool isDecryptionFailed () const noexcept
 EncryptionContext (const proto::MessageMetadata &, bool)

Friends

class ConsumerImpl

Detailed Description

It contains encryption and compression information in it using which application can decrypt consumed message with encrypted-payload.

Constructor & Destructor Documentation

◆ EncryptionContext()

pulsar::EncryptionContext::EncryptionContext ( const proto::MessageMetadata & ,
bool  )

This constructor is public to allow in-place construction via std::optional (e.g., std::optional<EncryptionContext>(std::in_place, metadata, false)), but should not be used directly in application code.

Member Function Documentation

◆ algorithm()

const std::string & pulsar::EncryptionContext::algorithm ( ) const
inlinenoexcept
Returns
the encryption algorithm used for the message

◆ batchSize()

int32_t pulsar::EncryptionContext::batchSize ( ) const
inlinenoexcept
Returns
the batch size if the message is part of a batch, -1 otherwise

◆ compressionType()

CompressionType pulsar::EncryptionContext::compressionType ( ) const
inlinenoexcept
Returns
the compression type used for the message

◆ isDecryptionFailed()

bool pulsar::EncryptionContext::isDecryptionFailed ( ) const
inlinenoexcept

When the ConsumerConfiguration#getCryptoFailureAction is set to CONSUME, the message will still be returned even if the decryption failed. This method is provided to let users know whether the decryption failed.

Returns
whether the decryption failed

◆ keys()

const KeysType & pulsar::EncryptionContext::keys ( ) const
inlinenoexcept
Returns
the map of encryption keys used for the message

◆ param()

const std::string & pulsar::EncryptionContext::param ( ) const
inlinenoexcept
Returns
the encryption parameter used for the message

◆ uncompressedMessageSize()

uint32_t pulsar::EncryptionContext::uncompressedMessageSize ( ) const
inlinenoexcept
Returns
the uncompressed message size if the message is compressed, 0 otherwise

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