[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [iaik-jce] RFC22253NameParser



Hello,
 
methods getName() and toString() of class iaik.structures.Name give the same (more readable) output. You may use method getRFC2253String() for getting a RFC2253 compatible string that may be converted back into a Name object when using RFC2253NameParser.
 
Regards,
Dieter Bratko
-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at [mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von Hiltenkamp, Andreas
Gesendet: Freitag, 27. Oktober 2000 16:44
An: 'iaik-jce@iaik.tu-graz.ac.at'
Betreff: [iaik-jce] RFC22253NameParser

there are some problems with the RFC22253NameParser
he is not able to parse the RDN of Verisign also not the RDN of TC Trustcenter
 
code is:
 
  X509Certificate x509;
  String[] values;
  Name issuer;
  Name subject;
 
  try
  {
   x509 = (X509Certificate)cert;
 

   System.out.println("issuer =" +  x509.getIssuerDN().getName() );
   issuer = parseRDNString(x509.getIssuerDN().getName());
   System.out.println("subject =" +  x509.getSubjectDN().getName() );
   subject = parseRDNString(x509.getSubjectDN().getName());
 
} catch (ClassCastException cce)
{
}
  catch ( RFC2253NameParserException npe )
  {
   System.out.println( "failed to parse DN " + npe.getMessage());
  }
  catch (Throwable t)
  {
   System.out.println("************************************" + t.getClass().getName() +
    (t.getMessage() != null ? t.getMessage() : "" )   );
  }
 
it also does not work when using "toString()" instead of "getName()"
 
Output looks like:
 
issuer =EMail=certificate@trustcenter.de,OU=TC TrustCenter Class 1 CA,O=TC Trust
Center for Security in Data Networks GmbH,L=Hamburg,ST=Hamburg,C=DE
subject =EMail=certificate@trustcenter.de,OU=TC TrustCenter Class 1 CA,O=TC Trus
tCenter for Security in Data Networks GmbH,L=Hamburg,ST=Hamburg,C=DE
************************************java.lang.NullPointerException
 
Why ? Any idea. Did I misunderstand something ?
 
Thanks.
 
 
 
 
***************************************************************************
*                                                                         *
* IAIK S/MIME Mapper Security Info                                        *
* ===================================                                     *
*                                                                         *
* for message:                                                            *
*   From: "Dieter Bratko" <Dieter.Bratko@iaik.at>                         *
*   Date: Fri, 27 Oct 2000 21:16:08 +0200                                 *
*   Subject: AW: [iaik-jce] RFC22253NameParser                            *
*                                                                         *
* Message S/MIME properties:                                              *
*                                                                         *
*   Encrypted using:    not encrypted                                     *
*                                                                         *
*   Digitally signed:   yes                                               *
*   Signature valid:    yes                                               *
*   Signature trusted:  yes                                               *
*                                                                         *
*                                                                         *
* Compliance with policy for email addresses *@iaik.at:                   *
*                                                                         *
*   Encryption:         OK (None or better required)                      *
*                                                                         *
*   Digital Signature:  OK (digital signature required)                   *
*                                                                         *
***************************************************************************