There is an example in OpenSSL. (I'm using 0.9.6c) Check out the file apps\apps.c and look for the functions load_cert and load_key. These will read the PKCS12 file and return either and X509 certificate (X509*) or a private key envelope (EVP_PKEY*). Once you have them, you just need to call SSL_CTX_use_certificate and SSL_CTX_use_PrivateKey. (instead of SSL_CTX_use_certificate_file)
Marc-André Lévesque -----Original Message----- From: Kin Jun [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 8:31 AM To: [EMAIL PROTECTED] Subject: How to use pkcs12 in SSL library Hello friends: How are you! I am Kinj. I am a beginner in OpenSSL. I am trying to realize client authentication with SSL library in my application. I suceeded in sending to a server by using .PEM file as follows: SSL_CTX_use_certificate_file(ctx, MyClient.pem, SSL_FILETYPE_PEM); SSL_CTX_use_RSAPrivateKey_file(ctx, MyPrivateKey.pem, SSL_FILETYPE_PEM); Now , I try to use pkcs12 format certificate file to access to the server. But in the OpenSSL document , there are a lot of information like this: "....The certificates must be in PEM format.... " What! How about pkcs12 ? My question is : How to use pkcs12 format certificates in SSL functions for client authentication? --Is OpenSSL library not supporting pkcs12 format for client authentication? --Which function can be used for the above purpose? and How to do it? I need your advice. Thank you for your help in advance. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]