Package de.otto.kafka.messaging.e2ee
Class DecryptionService
java.lang.Object
de.otto.kafka.messaging.e2ee.DecryptionService
This class do decrypt a message or payload.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decryptToByteArray(String kafkaTopicName, AesEncryptedPayload encryptedPayload) decrypts the given payload (depending on the content).decryptToString(String kafkaTopicName, AesEncryptedPayload encryptedPayload) decrypts the given payload (depending on the content).booleanhasSameEncryptionFlag(String kafkaTopicName, AesEncryptedPayload encryptedPayload) This method checks if the encryption "flag" of the kafka topic matches the payload.
-
Constructor Details
-
DecryptionService
-
-
Method Details
-
decryptToByteArray
decrypts the given payload (depending on the content).- Parameters:
kafkaTopicName- name of the Kafka Topic the field value is from.encryptedPayload- the (potentially) encrypted payload.- Returns:
- The plain text payload
-
decryptToString
decrypts the given payload (depending on the content).- Parameters:
kafkaTopicName- name of the Kafka Topic the field value is from.encryptedPayload- the (potentially) encrypted payload.- Returns:
- The plain text
-
hasSameEncryptionFlag
This method checks if the encryption "flag" of the kafka topic matches the payload. This method can be used by a kafka topic consumer the control the kafka producer.- Parameters:
kafkaTopicName- name of the Kafka Topic the payload is from.encryptedPayload- the (potentially) encrypted payload.- Returns:
truewhen the topic is marked as encrypted and the payload is encrypted or when the topic is not encrypted as well as the payload.
-