Re: how to download a certificate to browser?

2000-02-29 Thread alohaz
Yes! the certificate signed by CA is in format of DER and stored in cert.result. now that section is as following to return the certificate to browser: CERT=fopen("/usr/local/ssl/certs/cert.result"); printf(Content-Type: application/x-x509-user-cert\n\n"); while ((ch=getc(CERT))!= EOF)

Re: how to download a certificate to browser?

2000-02-29 Thread Goetz Babin-Ebell
At 16:16 29.02.00 +0800, you wrote: Yes! the certificate signed by CA is in format of DER and stored in cert.result. now that section is as following to return the certificate to browser: CERT=fopen("/usr/local/ssl/certs/cert.result"); printf(Content-Type: application/x-x509-user-cert\n\n");

RE: how to download a certificate to browser?

2000-02-29 Thread Salz, Rich
DER is a binary format, and could well have nul bytes and other values outside the domain of C strings. while ((ch=getc(CERT))!= EOF) putchar(ch); Make sure that it's "int ch;" __ OpenSSL Project

RE: how to download a certificate to browser?

2000-02-29 Thread Barnes, Michael L.
You can't usually use printf("%s") on binary data because it will stop at the first NULL. I've enclosed a simple working sample. #include stdio.h #include string.h #include stdlib.h #include sys/stat.h #include unistd.h int main(int argc, char **argv) { FILE *in; void *buf;

Re: how to download a certificate to browser?

2000-02-25 Thread Jochen . Klein
I set up my own CA and sign client certificates. I can use the program of perl provided by F.J Hirsch in his paper" Introducing SSL and Certificates using SSLeay" to download certificate to netscape browser. But I can not use my C program to do the work. [...] And this is my C program:

Re: how to download a certificate to browser?

2000-02-25 Thread alohaz
Thanks a lot to Robert,Mike and Massimiliano for your help. I got a some suggestion form Hirsch as following: I believe the problem is that the join can take multiple lines (if the cert is over multiple lines, and make them into one string), but the C++ code is including the newlines. I am

how to download a certificate to browser?

2000-02-24 Thread alohaz
Hi, everyone: I set up my own CA and sign client certificates. I can use the program of perl provided by F.J Hirsch in his paper" Introducing SSL and Certificates using SSLeay" to download certificate to netscape browser. But I can not use my C program to do the work. This is