Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Get values from CA certificate.  RSS feed

 
Mubeen Shaik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using "java.security.cert.X509Certificate" for the first time. I want to get CN, OU, O from a certificate, (DN names).

When I use "getIssuerDN()" method it is giving me entire string.

My question is how to parse each value from this string?.

Thanks in advance,
Mubeen.
 
John Gregory
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do a lot of work with dn's. So, should be delimited,
somehow - my experience is the delimiter is usually a , or
a /. You could Split on that and then you'd have an String
array (String [] ldapStruct.

your name should be in ldapStruct[0] and your root node should
be in ldapStruct.length -1.

John
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!