Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interpreting SubjectAlternativeNames

843810May 28 2004 — edited May 31 2004
Hi,

I have the following code and i am trying to obtain the name field stored in the Subject Alternative Name with oid "1.3.6.1.4.1.5734.1.1" in a X509Certificate object.

...
//
// <X509Certificate object> obtained from a CMS message created with the BouncyCastle API.
java.security.cert.X509Certificate cert =<X509Certificate object>

Collection altNames = cert.getSubjectAlternativeNames();

for (Iterator ani = altNames.iterator(); ani.hasNext();)
logger.info(ani.next().toString());
...

This is the output: (only one element of directoryName type)

[4, 1.3.6.1.4.1.5734.1.1=#13087573756172696f31,1.3.6.1.4.1.5734.1.2=#13086170653175737531,1.3.6.1.4.1.5734.1.3=#13086170653275737561,1.3.6.1.4.1.5734.1.4=#1309303030303030303161]

I am not able to obtain a GeneralName or X509Name object that let me read this content. Does anybody know how to interpret this collection getting each oid value separately?.

Thanks all.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2004
Added on May 28 2004
1 comment
372 views