aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java
index 5425baa..09b7e6b 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java
@@ -109,7 +109,7 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo
*/
public String getName()
{
- return this.x509Certificate.getSubjectDN().getName();
+ return this.x509Certificate.getSubjectDN().toString();
}
/**
@@ -205,12 +205,24 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo
private void fillDNMap(String dn, Map dnMap) {
- String[] arr = dn.split("\\s*(,|;)\\s*");
+ // split at "," but not at "\,"
+ String[] arr = dn.split("\\s*(?<![\\\\]),\\s*");
+
for (int i = 0; i < arr.length; i++) {
String[] entry = arr[i].split("\\s*(=)\\s*");
+
+ // resolve escaped values according to RFC2253
+ entry[1] = entry[1].replaceAll("\\\\,", ","); // \, -> ,
+ entry[1] = entry[1].replaceAll("\\\\+", "+"); // \+ -> +
+ entry[1] = entry[1].replaceAll("\\\\\"", "\""); // \" -> "
+ entry[1] = entry[1].replaceAll("\\\\\\\\", "\\"); // \\ -> \
+ entry[1] = entry[1].replaceAll("\\\\<,", "<"); // \< -> <
+ entry[1] = entry[1].replaceAll("\\\\>", ">"); // \> -> >
+ entry[1] = entry[1].replaceAll("\\\\;", ";"); // \; -> ;
+ entry[1] = entry[1].replaceAll("\\\\#", "#"); // \# -> #
+
dnMap.put(entry[0], entry[1]);
}
}
-
}