On Mon, Nov 10, 2003, Sebastian Osten wrote:

> Hi all!
> I'm trying to scratch a distpoint from an X509 certificate. The code is shown 
> below. It works, but it's a little bit dirty... 
> 'i2d_DIST_POINT_NAME' delivers me the distpoints, but I have to skip four 
> bytes the extract the string.
> 
> Does anyone know:
> - The data type created by 'i2d_DIST_POINT_NAME' ?
> - An openssl-standard function, that is able to extract the string?
> - Another approuch to extract the CRL-Distpoints from an X509v3-cert?
> 
> 

See doc/openssl.txt...

To summarixe:

Use X509_get_ext_d2i() to get a STACK_OF(DIST_POINT) *foo (say).

This contains sk_DIST_POINT_num(foo) accessible as
sk_DIST_POINT_value(foo, i).

Each is a DIST_POINT defined in x509v3.h.

You probably want fullname which is a STACK_OF(GENERAL_NAME). Iterate through
those and examine the GENERAL_NAME structure.

Check type of each until you find one you like, probably GEN_URI. Then look in
gen->d.uniformResourceIdentifier which is an ASN1_IA5STRING structure.

This will contain ASN1_STRING_length(ia5) bytes at ASN1_STRING_data(ia5).

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to