C language function:CryptExportPKCS8 sample codes

Search sample code in the internet.It is the result.

TITLE : PFXExportCertStoreEx function (Windows)
BOOL WINAPI CryptExportPKCS8(.......

TITLE : c++ - Converting private key in windows store to PEM (for OpenSSL) - Stack Overflow
CryptExportPKCS8() end of support ended with XP/2003, so we have to use PFXExportCertStoreEx() , however this function exports the WHOLE store. So, in order to export just one certificate you need to use a memory store........
search Google