I need to do mutual SSL authentication from my client app (C++) using OpenSSL (via libcurl). I am reading certs from a smart card via MS Crypto API (CAPI) and ActivClient driver, and doing cert-chain validation with CAPI (this seemed to be easier validating the cert chain with OpenSSL since the cert chain is in the MS cert store). I can convert the client cert from CAPI to OpenSSL, but I'm having problems with the private key.
It seems that, for the server to validate my client's cert, I need to expose the client cert private key to OpenSSL. It's not quite clear how I should do that, or even if I can do that (it may depend on whether the key is marked as "exportable" in the cert). I can try following the suggestions in Converting private key in windows store to PEM (for OpenSSL), and hope the key is exportable, but I wonder whether I am even going down the correct path.
I've searched quite a bit on this topic, but haven't found any conclusive info.
Any advice and/or suggestions are appreciated!!