merlimat commented on a change in pull request #1129: Added end to end encryption in C++ client URL: https://github.com/apache/incubator-pulsar/pull/1129#discussion_r164924605
########## File path: pulsar-client-cpp/lib/ConsumerConfiguration.cc ########## @@ -74,4 +74,25 @@ void ConsumerConfiguration::setUnAckedMessagesTimeoutMs(const uint64_t milliSeco } impl_->unAckedMessagesTimeoutMs = milliSeconds; } + +bool ConsumerConfiguration::isEncryptionEnabled() const { + return (impl_->cryptoKeyReader != NULL); +} + +const CryptoKeyReader& ConsumerConfiguration::getCryptoKeyReader() const { return *(impl_->cryptoKeyReader); } + +ConsumerConfiguration& ConsumerConfiguration::setCryptoKeyReader(CryptoKeyReader& cryptoKeyReader) { Review comment: Instead of getting a reference and storing a pointer, we should take either a copy or a `shared_ptr` from the user. That would avoid any problem on the life cycle of the crypto reader. Otherwise the use needs to know it cannot be destructed and that will lead to unexpected segfaults. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services