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)
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");
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
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;
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:
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
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