Interpreting SubjectAlternativeNames
843810May 28 2004 — edited May 31 2004Hi,
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.