diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-12-01 15:44:23 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-12-01 15:44:23 +0000 |
commit | dfb14689d6d7b5db8f518d8e908571e29ca7afe1 (patch) | |
tree | 52c8b2fec39dc7493a55f57ceb1c6c700172b704 /src/main/java/at/knowcenter/wag | |
parent | 1240ac7d4042224dcf5e9cebbe44b922b21cbc8f (diff) | |
download | pdf-as-3-dfb14689d6d7b5db8f518d8e908571e29ca7afe1.tar.gz pdf-as-3-dfb14689d6d7b5db8f518d8e908571e29ca7afe1.tar.bz2 pdf-as-3-dfb14689d6d7b5db8f518d8e908571e29ca7afe1.zip |
Splitting Names like "serialNumber=xxx,CN=Abteilung,OU=Unterorganisation\, die der Organisation untergeordnet ist,O=Organisation,C=AT" fixed.
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@663 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/SignSignatureObject.java | 18 |
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]);
}
}
-
}
|