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

[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.