From 65f65796b2befd53b12fa76d05a640d30c0867cf Mon Sep 17 00:00:00 2001 From: Nho Quy Dinh Date: Tue, 17 Dec 2024 12:13:44 +0100 Subject: [PATCH] Throw Exception on db decryption/encryption issue --- .../component/TextEncryptorConverter.java | 18 ++++++++++-------- .../alovoa/model/DatabaseRuntimeException.java | 8 ++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/nonononoki/alovoa/model/DatabaseRuntimeException.java diff --git a/src/main/java/com/nonononoki/alovoa/component/TextEncryptorConverter.java b/src/main/java/com/nonononoki/alovoa/component/TextEncryptorConverter.java index c6075a23..835523f9 100644 --- a/src/main/java/com/nonononoki/alovoa/component/TextEncryptorConverter.java +++ b/src/main/java/com/nonononoki/alovoa/component/TextEncryptorConverter.java @@ -13,6 +13,8 @@ import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; + +import com.nonononoki.alovoa.model.DatabaseRuntimeException; import jakarta.persistence.AttributeConverter; import org.springframework.beans.factory.annotation.Value; @@ -36,21 +38,21 @@ public class TextEncryptorConverter implements AttributeConverter