pulsar-client-cpp
CryptoKeyReader.h
1 
19 #ifndef CRYPTOKEYREADER_H_
20 #define CRYPTOKEYREADER_H_
21 
22 #include <pulsar/Result.h>
23 #include <pulsar/EncryptionKeyInfo.h>
24 
25 #pragma GCC visibility push(default)
26 
27 namespace pulsar {
28 
30  public:
31  virtual ~CryptoKeyReader() {}
32 
33  /*
34  * Return the encryption key corresponding to the key name in the argument
35  * <p>
36  * This method should be implemented to return the EncryptionKeyInfo. This method will be
37  * called at the time of producer creation as well as consumer receiving messages.
38  * Hence, application should not make any blocking calls within the implementation.
39  * <p>
40  *
41  * @param keyName
42  * Unique name to identify the key
43  * @param metadata
44  * Additional information needed to identify the key
45  * @param encKeyInfo updated with details about the public key
46  * @return Result ResultOk is returned for success
47  *
48  */
49  virtual Result getPublicKey(const std::string& keyName, std::map<std::string, std::string>& metadata,
50  EncryptionKeyInfo& encKeyInfo) const = 0;
51 
52  /*
53  * @param keyName
54  * Unique name to identify the key
55  * @param metadata
56  * Additional information needed to identify the key
57  * @param encKeyInfo updated with details about the private key
58  * @return Result ResultOk is returned for success
59  */
60  virtual Result getPrivateKey(const std::string& keyName, std::map<std::string, std::string>& metadata,
61  EncryptionKeyInfo& encKeyInfo) const = 0;
62 
63 }; /* namespace pulsar */
64 
65 typedef std::shared_ptr<CryptoKeyReader> CryptoKeyReaderPtr;
66 } // namespace pulsar
67 
68 #pragma GCC visibility pop
69 
70 #endif /* CRYPTOKEYREADER_H_ */
pulsar::EncryptionKeyInfo
Definition: EncryptionKeyInfo.h:35
pulsar::Result
Result
Definition: Result.h:31
pulsar::CryptoKeyReader
Definition: CryptoKeyReader.h:29
pulsar
Definition: Authentication.h:31