trexinc commented on a change in pull request #6763:
URL: https://github.com/apache/pulsar/pull/6763#discussion_r416798954
##########
File path: site2/docs/security-encryption.md
##########
@@ -78,18 +78,20 @@ class RawFileKeyReader implements CryptoKeyReader {
return keyInfo;
}
}
-PulsarClient pulsarClient = PulsarClient.create("http://localhost:8080");
-ProducerConfiguration prodConf = new ProducerConfiguration();
-prodConf.setCryptoKeyReader(new RawFileKeyReader("test_ecdsa_pubkey.pem",
"test_ecdsa_privkey.pem"));
-prodConf.addEncryptionKey("myappkey");
+PulsarClient pulsarClient =
PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build();
-Producer producer =
pulsarClient.createProducer("persistent://my-tenant/my-ns/my-topic", prodConf);
+Producer producer = pulsarClient.newProducer()
+ .topic("persistent://my-tenant/my-ns/my-topic")
+ .addEncryptionKey("myappkey")
Review comment:
Its just a “tag” for the key. So the consumer knows with which key to
decrypt. As basically every producer can use a different encryption key
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]