pulsar-client-cpp
Public Member Functions | Static Public Member Functions | List of all members
pulsar::DefaultCryptoKeyReader Class Reference
Inheritance diagram for pulsar::DefaultCryptoKeyReader:
pulsar::CryptoKeyReader

Public Member Functions

 DefaultCryptoKeyReader (const std::string &publicKeyPath, const std::string &privateKeyPath)
 
Result getPublicKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const
 
Result getPrivateKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const
 

Static Public Member Functions

static CryptoKeyReaderPtr create (const std::string &publicKeyPath, const std::string &privateKeyPath)
 

Constructor & Destructor Documentation

◆ DefaultCryptoKeyReader()

pulsar::DefaultCryptoKeyReader::DefaultCryptoKeyReader ( const std::string &  publicKeyPath,
const std::string &  privateKeyPath 
)

The constructor of CryptoKeyReader

Configure the key reader to be used to decrypt the message payloads

Parameters
publicKeyPaththe path to the public key
privateKeyPaththe path to the private key
Since
2.8.0

Member Function Documentation

◆ getPrivateKey()

Result pulsar::DefaultCryptoKeyReader::getPrivateKey ( const std::string &  keyName,
std::map< std::string, std::string > &  metadata,
EncryptionKeyInfo encKeyInfo 
) const
virtual

Return the encryption key corresponding to the key name in the argument.

Parameters
[in]keyNamethe unique name to identify the key
[in]metadatathe additional information needed to identify the key
[out]encKeyInfothe EncryptionKeyInfo with details about the private key
Returns
ResultOk

Implements pulsar::CryptoKeyReader.

◆ getPublicKey()

Result pulsar::DefaultCryptoKeyReader::getPublicKey ( const std::string &  keyName,
std::map< std::string, std::string > &  metadata,
EncryptionKeyInfo encKeyInfo 
) const
virtual

Return the encryption key corresponding to the key name in the argument.

This method should be implemented to return the EncryptionKeyInfo. This method is called when creating producers as well as allowing consumers to receive messages. Consequently, the application should not make any blocking calls within the implementation.

Parameters
[in]keyNamethe unique name to identify the key
[in]metadatathe additional information needed to identify the key
[out]encKeyInfothe EncryptionKeyInfo with details about the public key
Returns
ResultOk

Implements pulsar::CryptoKeyReader.


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