On Thu, Jul 29, 2004, Pablo J Royo wrote:

> Hello:
> 
> I have a subject string in its common format:
> 
> C=XX /O=xxxxxxx /OU=yyyyyyyyyy /CN=zzzzzzzzz...etc
> 
> and IŽd like to create a X509_NAME object with it, in order to handle its
> different fields (X509_NAME_ENTRY) correctly.
> Is there any function in OpenSSL X509 interface to do this (as easy as
> possible)?
> 

There isn't an OpenSSL library function to do this but the openssl utility has
some code that will parse things in that format.

There are some things to be careful of such as how to handle embedded '/'
within fields.

If you can split that into a set of name value strings ("CN", "XX") ("O",
"xxxx") you can then call the standard X509_NAME_add_entry_by_txt() call. 

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://www.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