How to extract information from x509 Certificate?

Posted on 2004-09-17
Medium Priority
Last Modified: 2008-02-01
hi all,
I wish to extract information from x509Certificate, I know that we can retrieve such as certificate serial number, version subjectDN from the available API.

Is there any API available for us to retrieve information such as Common Name, Oraganization Unit, Locality etc? or we need to develop our own program to parse the information??

Please guide..thanks

Question by:pleasure
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3

Author Comment

ID: 12085880
X509Certificate has a method called getSubjectDN which will return the certificate's subject distinguished name. Subject DN normally will contain string like 'CN=www.experts-exchange.com.my, OU=Organization Unit, O=Oragnization'

My question is, is there any available API for us to parse 'CN=www.experts-exchange.com, OU=Organization Unit, O=Oragnization' ? For example, when I wish to get the value for CN, the API will return me 'www.experts-exchange.com'.

Is it we need to develop the program ourself?

LVL 86

Accepted Solution

CEHJ earned 150 total points
ID: 12086013
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI


Author Comment

ID: 12086218
It's new class in JDK 1.5?? do you know of any class that we can use for JDK 1.4??
LVL 86

Expert Comment

ID: 12086292
Sorry - didn't notice that. Anything that implements the Name interface (since 1.3) should help. You might have to do a little hand-parsing yourself too
LVL 86

Expert Comment

ID: 12086353

Author Comment

ID: 12086354
CEHJ, thanks for the information
LVL 86

Expert Comment

ID: 12086379
Pleasure pleasure ;-)

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question