From 6feffb896cd9026481717a06ac754c94f25c0751 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 30 Nov 2010 18:20:55 +0000 Subject: OID-Map added in order to support all commons subject DNs git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@655 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../sig/connectors/bku/SignSignatureObject.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov') 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 f857fb0..e90f491 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 @@ -9,6 +9,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; +import javax.security.auth.x500.X500Principal; + import at.gv.egiz.pdfas.api.timestamp.TimeStamper; import at.knowcenter.wag.egov.egiz.sig.SignatureTypes; import at.knowcenter.wag.egov.egiz.sig.signatureobject.AdditionalSignatureInformation; @@ -38,6 +40,25 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo public String sigTimeStamp; + private final static Map OIDMAP; + + static { + OIDMAP = new HashMap(); + OIDMAP.put("2.5.4.4", "SN"); + OIDMAP.put("2.5.4.5", "serialNumber"); + OIDMAP.put("2.5.4.6", "C"); + OIDMAP.put("2.5.4.7", "L"); + OIDMAP.put("2.5.4.8", "ST"); + OIDMAP.put("2.5.4.9", "STREET"); + OIDMAP.put("2.5.4.10", "O"); + OIDMAP.put("2.5.4.11", "OU"); + OIDMAP.put("2.5.4.12", "T"); + OIDMAP.put("2.5.4.42", "givenName"); + OIDMAP.put("2.5.4.43", "initials"); + OIDMAP.put("2.5.4.45", "uniqueIdentifier"); + OIDMAP.put("2.5.4.65", "pseudonym"); + } + /** * This is used to transport the response properties to the Detached signator. */ @@ -174,8 +195,8 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo public Map getSubjectDNMap() { if (this.subjectDNMap.size() == 0) { - if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getSubjectX500Principal().getName(), this.subjectDNMap); + if (this.getX509Certificate() != null) { + fillDNMap(this.getX509Certificate().getSubjectX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.subjectDNMap); } } return this.subjectDNMap; @@ -200,7 +221,7 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo public Map getIssuerDNMap() { if (this.issuerDNMap.size() == 0) { if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(), this.issuerDNMap); + fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.issuerDNMap); } } return this.issuerDNMap; @@ -209,7 +230,7 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo public String certIssuerDNPart(String key) { if (this.issuerDNMap.size() == 0) { if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(), this.issuerDNMap); + fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.issuerDNMap); } } return (String)this.getIssuerDNMap().get(key); -- cgit v1.2.3