aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java
index 57597122..b86984d0 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java
@@ -46,6 +46,7 @@ public class SimpleEidasData {
/**
* Compares the register result with the eidas data.
+ *
* @param result The register data to use for comparison
* @return true or false depending of the data matches
* @throws WorkflowException if multiple results have been found
@@ -67,15 +68,28 @@ public class SimpleEidasData {
if (!result.getDateOfBirth().equals(dateOfBirth)) {
return false;
}
- if (!result.getPlaceOfBirth().equals(placeOfBirth)) {
+ if (!equals(result.getPlaceOfBirth(), placeOfBirth)) {
return false;
}
- if (!result.getBirthName().equals(birthName)) {
+ if (!equals(result.getBirthName(), birthName)) {
return false;
}
- if (!result.getTaxNumber().equals(taxNumber)) {
+ if (!equals(result.getTaxNumber(), taxNumber)) {
return false;
}
return true;
}
+
+ private boolean equals(String a, String b) {
+ if (a == null && b == null) {
+ return true;
+ }
+ if (a == null && b != null) {
+ return false;
+ }
+ if (a != null && b == null) {
+ return false;
+ }
+ return a.equals(b);
+ }
}