massakam opened a new pull request #9379:
URL: https://github.com/apache/pulsar/pull/9379


   Currently, users must implement the `CryptoKeyReader` interface for 
end-to-end message encryption in Java. I thought it would be useful to have a 
default implementation, so I added `DefaultCryptoKeyReader`.
   
   How to use:
   ```java
   Producer<byte[]> producer = pulsarClient.newProducer()
           .topic("persistent://public/default/test")
           .addEncryptionKey("my-app-key1")
           .defaultCryptoKeyReader("file:///path/to/public.key")
           .create();
   
   Consumer<byte[]> consumer = pulsarClient.newConsumer()
           .topic("persistent://public/default/test")
           .subscriptionName("sub1")
           .defaultCryptoKeyReader(new HashMap<String, String>() {
               {
                   put("my-app-key1", "file:///path/to/private.key");
                   put("my-app-key2", 
"data:application/x-pem-file;base64,*****");
               }
           })
           .subscribe();
   ```


----------------------------------------------------------------
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]


Reply via email to