On Mon, Feb 06, 2012, Kacper86 wrote: > Hi, > > I would like to use openssl library in my iOS application > (Objective-C) to generate certificate signing request. > > If I wanted to use openssl application in linux I would write > something like that: > > openssl req -new -newkey rsa:2048 -nodes -out common_name.csr > -keyout common_name.key -subj > "/C=pl/ST=state/L=city/O=organization/OU=department/CN=common_name" > > However, I have to use openssl as a library. Can I ask for some > hints on how to do it or what documents should I read in the first > place? Do I have to separately create public/private keys and then > use them to create CSR? > > I found out that there a few functions which are responsible for > creating CSR: > > int PEM_write_bio_X509_REQ(BIO *bp, X509_REQ *x); > int PEM_write_X509_REQ(FILE *fp, X509_REQ *x); > int PEM_write_bio_X509_REQ_NEW(BIO *bp, X509_REQ *x); > int PEM_write_X509_REQ_NEW(FILE *fp, X509_REQ *x); > > 1. I assume that after calling PEM_write_X509_REQ_NEW(), file fp > will contain csr only, like this: > > -----BEGIN CERTIFICATE REQUEST----- > ... > -----END CERTIFICATE REQUEST----- > > 2. is there any info on how to initialize X509_REQ object? >
Have a look at demos/x509/mkreq.c Steve. -- Dr Stephen N. Henson. OpenSSL project core developer. Commercial tech support now available see: http://www.openssl.org ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [email protected] Automated List Manager [email protected]
