Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.11 KB

File metadata and controls

42 lines (29 loc) · 1.11 KB

Key repository sample (Consumer API)

In this example, an encryption key reference is stored in the record payload. The encryption key is generated by (and stored in) the key repository. Two records with the same record’s key embed the same encryption key reference. The key repository in this example is a simple in memory repository but it would be a key vault such as Google Cloud KMS or Hashicorp Vault in a real world example.

Running the sample

cd samples/kafka-encryption-keyrepo-sample
docker-compose up # on windows and OSX, you need to adjust
sh runSamples.sh

Usage

Sample Main
link:./src/main/java/io/quicksign/kafka/crypto/samples/keyrepo/SamplesMain.java[role=include]
Producer side
link:./src/main/java/io/quicksign/kafka/crypto/samples/keyrepo/SampleProducer.java[role=include]
Consumer side
link:./src/main/java/io/quicksign/kafka/crypto/samples/keyrepo/SampleDecryptingConsumer.java[role=include]