From e226bfd7d2d2636745630f9d92ad2fed7186458b Mon Sep 17 00:00:00 2001 From: "peter.danner" Date: Tue, 24 Apr 2007 08:14:45 +0000 Subject: updated usage of RFC2253NameParser git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@816 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/spss/server/config/IssuerAndSerial.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'spss.server/src/at/gv/egovernment/moa/spss') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java index 9d9262785..0814c90d6 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java @@ -33,14 +33,24 @@ public class IssuerAndSerial { * @param serial The serial number of the certificate. */ public IssuerAndSerial(Principal issuer, BigInteger serial) { - RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); - - try { - this.issuerDN = ((Name) parser.parse()).getRFC2253String(); - } catch (RFC2253NameParserException e) { - this.issuerDN = issuer.getName(); + String issuerDN = null; + if (issuer instanceof Name) { + try { + issuerDN = ((Name)issuer).getRFC2253String(); + } catch (RFC2253NameParserException e) { + // do nothing + } + } + if (issuerDN == null) { + RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); + try { + issuerDN = ((Name)parser.parse()).getRFC2253String(); + } catch (RFC2253NameParserException e) { + issuerDN = issuer.getName(); + } } this.serial = serial; + this.issuerDN = issuerDN; } /** -- cgit v1.2.3