Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

X509_NAME_oneline

537 views
Skip to first unread message

Kevin Coffman

unread,
Feb 20, 2004, 10:57:03 AM2/20/04
to
I read in a posting somewhere that X509_NAME_oneline() is depracated.
Can someone tell me the preferred alternative?

Thanks,
K.C.

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openss...@openssl.org
Automated List Manager majo...@openssl.org

francesco...@innovery.it

unread,
Feb 20, 2004, 11:09:21 AM2/20/04
to
You can use X509_NAME_print_ex(...)

for example:

char * X509_NAME_oneline_ex(X509_NAME *a,char *buf,int *size,unsigned long
flag) {
BIO *out=NULL;

out=BIO_new(BIO_s_mem());
if(X509_NAME_print_ex(out,a,0,flag)>0) {
if (buf!=NULL && *size>(int)BIO_number_written(out)) {
memset(buf,0,*size);
BIO_read(out,buf,BIO_number_written(out));
} else {
*size=BIO_number_written(out);
}
}
BIO_free(out);
return (buf);
}

char * X509_NAME_oneline_readable(X509_NAME *a,char *buf,int size) {
return X509_NAME_oneline_ex(a,buf,size,XN_FLAG_ONELINE);
}

/* reverse */
char * X509_NAME_oneline_RFC2253(X509_NAME *a,char *buf,int size) {
return X509_NAME_oneline_ex(a,buf,size,XN_FLAG_RFC2253);
}

there are some other flags, see documentation.

Francesco Petruzzi

francesco...@innovery.it

0 new messages