From a896c0c83187b9b1f1decbb372e27f227d57b86c Mon Sep 17 00:00:00 2001 From: pdanner Date: Wed, 1 Dec 2010 14:49:32 +0000 Subject: improved RDN Map, removed static oid map (java 1.6) git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@660 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../sig/connectors/bku/SignSignatureObject.java | 65 ++++++---------------- 1 file changed, 16 insertions(+), 49 deletions(-) (limited to 'src/main/java/at') 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 e90f491..5425baa 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,8 +9,6 @@ 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; @@ -40,25 +38,6 @@ 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. */ @@ -192,47 +171,35 @@ public class SignSignatureObject implements Serializable, MandatorySignatureInfo // dferbas + + /** + * Get a timestamp if available as b64 string + * @see TimeStamper + * @return + */ + public String getSigTimeStamp() { + return this.sigTimeStamp; + } public Map getSubjectDNMap() { - if (this.subjectDNMap.size() == 0) { - if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getSubjectX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.subjectDNMap); - } + if (this.subjectDNMap.size() == 0 && this.getX509Certificate() != null) { + fillDNMap(this.getX509Certificate().getSubjectDN().getName(), this.subjectDNMap); } - return this.subjectDNMap; - + return this.subjectDNMap; } - public String certSubjectDNPart(String key) { - + public String certSubjectDNPart(String key) { return (String)this.getSubjectDNMap().get(key); } - - /** - * Get a timestamp if available as b64 string - * @see TimeStamper - * @return - */ - public String getSigTimeStamp() { - return this.sigTimeStamp; - } - public Map getIssuerDNMap() { - if (this.issuerDNMap.size() == 0) { - if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.issuerDNMap); - } + if (this.issuerDNMap.size() == 0 && this.getX509Certificate() != null) { + fillDNMap(this.getX509Certificate().getIssuerDN().getName(), this.issuerDNMap); } return this.issuerDNMap; } - public String certIssuerDNPart(String key) { - if (this.issuerDNMap.size() == 0) { - if (this.getX509Certificate() != null) { - fillDNMap(this.getX509Certificate().getIssuerX500Principal().getName(X500Principal.RFC2253, OIDMAP), this.issuerDNMap); - } - } + public String certIssuerDNPart(String key) { return (String)this.getIssuerDNMap().get(key); } -- cgit v1.2.3