"Hellan,Kim KHE" wrote: > > Hi > > I have a certificate with a crlDistributionPoint extension. Using OpenSSL > terms, the extension consists of two DIST_POINT*.....one of the type > GEN_DIRNAME and the other of the type GEN_URI. > In my code I have "parsed" these DIST_POINT* and what I end up with is a > GENERAL_NAME* for each distribution point. > To get a readable text, I do a i2d_GENERAL_NAME().
You shoudln't do that. That will give you the DER encoded version of the GENERAL_NAME. That's not readable text. > > But what I really want is a readable text only, like the one you get when > OpenSSL dumps information about an X.509 certificate: > > DirName:/C=DK/O=xxx Internet/OU=xxx Class II CA/CN=MainCRL > URI:http://xxxx.xxxx.dk/Class_II.crl > > How can I parse the crlDistributionPoint to get these two texts returned: > /C=DK/O=xxx Internet/OU=xxx Class II CA/CN=MainCRL > http://xxxx.xxxx.dk/Class_II.crl > To do this you could examine the GENERAL_NAME type and handle each case as specified by the 'type' field. Then you'll have to handle the ASN1_IA5STRING and X509_NAME structures to get the above output. Alternatively if you just want a readable version of the extension you can use X509V3_EXT_print. Steve. -- Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/ Personal Email: [EMAIL PROTECTED] Senior crypto engineer, Gemplus: http://www.gemplus.com/ Core developer of the OpenSSL project: http://www.openssl.org/ Business Email: [EMAIL PROTECTED] PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]