I've been trying to get SSL_CTX_use_PrivateKey_ASN1 to
load in a der encoded private key without success. I
have gotten my application working with pem encoded
certificates but have hit a brick wall with loading
der encoded private keys(I have no problem loading the
client/ca certs)
The code leading up to the SSL_CTX_use_PrivateKey_ASN1
call is as so:
FILE *fp = fopen(clientKeyFile, "r");
if{fp != NULL) {
// get the length of the key(why cant
SSL_CTX_use_PrivateKey_ASN1 do this?)
char *buf = new char[BUF_SIZE];
int len = fread(buf, sizeof(char), BUF_SIZE, fp);
fclose(fp);
delete buf;
if(!(SSL_CTX_use_PrivateKey_ASN1(SSL_FILETYPE_ASN1,
my_ssl_ctx, (unsigned char *)clientKeyFile, len))) {
fprintf(stderr, "Error loading key\n");
}
}
Am I using the right function call? To load pem
encoded keys I was using the following:
SSL_CTX_use_PrivateKey_file(ss->my_ssl_ctx,
clientKeyFile, SSL_FILETYPE_PEM) which works fine.
Thanks in advance,
Dermot
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]