Class VaultEncryptionKeyProvider
java.lang.Object
de.otto.kafka.messaging.e2ee.vault.VaultEncryptionKeyProvider
- All Implemented Interfaces:
EncryptionKeyProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.otto.kafka.messaging.e2ee.EncryptionKeyProvider
EncryptionKeyProvider.KeyVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEncryptedTopic(String kafkaTopicName) retrieveKeyForDecryption(String topic, int version) retrieveKeyForDecryption(String topic, int version, String encryptionKeyAttributeName) retrieveKeyForEncryption(String kafkaTopicName)
-
Constructor Details
-
VaultEncryptionKeyProvider
-
-
Method Details
-
retrieveKeyForEncryption
- Specified by:
retrieveKeyForEncryptionin interfaceEncryptionKeyProvider- Parameters:
kafkaTopicName- the name of the topic to encrypt- Returns:
- a key for encryption or
nullif encryption is not needed
-
retrieveKeyForDecryption
- Specified by:
retrieveKeyForDecryptionin interfaceEncryptionKeyProvider- Parameters:
topic- the name of the topic to decryptversion- the version of the key- Returns:
- base64 and URL-Encoded encoded key
-
retrieveKeyForDecryption
public String retrieveKeyForDecryption(String topic, int version, String encryptionKeyAttributeName) - Specified by:
retrieveKeyForDecryptionin interfaceEncryptionKeyProvider- Parameters:
topic- the name of the topic to decryptversion- the version of the keyencryptionKeyAttributeName- the name of the encryption key within the vault. Whennullthen the default value must be used.- Returns:
- base64 and URL-Encoded encoded key
-
isEncryptedTopic
- Specified by:
isEncryptedTopicin interfaceEncryptionKeyProvider- Parameters:
kafkaTopicName- the name of the topic- Returns:
truewhen the topic can contain encrypted payloads
-