i want to export certificates with private keys into a pfx file.
But when i have a certificate with the option 'private key not exportable'
the function
PFXExportCertStoreEx return FALSE.
How can i export all Certificates with the option private key exportable in
a file.
hSystemStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL,
CERT_SYSTEM_STORE_CURRENT_USER, L"MY"))
...
PFXExportCertStoreEx(hSystemStore, &Save_Store_Blob, lpcwszPasswd, NULL,
EXPORT_PRIVATE_KEYS)
Thanx
Ilhami
What OS did you try this on?
--
Daniel Sie [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ilhami" <ilhami...@web.de> wrote in message
news:a4g5c4$mt...@news-1.bank.dresdner.net...
I have a MY store with several certs, some having private exportable keys,
some not. I gather that PFXExportCertStoreEx is
designed to export ALL the certs and keys in one shot, so this function
must iterate through the specified cert store in some way?
How do I target ONE specific key/cert to export (like the manual Export process
from within IE security panels) into a pfxblob with this function, or must I do
this manually?
Thanks,
- Mitch Gallant
What flag did you pass to the function? Do you use
REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY?
--
Daniel Sie [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michel Gallant" <neu...@istar.ca> wrote in message
news:3C9F9B38...@istar.ca...
if pfx file is saved that byte buffer, it is made a error when the file is
duble-clicked
i'd like to make a itself-installed file when i duble-click.
how can i make a this file?
if anyone has a sample code, send me please.
"Michel Gallant" <neu...@istar.ca> wrote in message
news:3CA15103...@istar.ca...
if (PFXExportCertStoreEx(hSystemStoreHandle, &pfxBlob, "xxxxxxxxx",
NULL, EXPORT_PRIVATE_KEYS) ) {
printf("%u bytes read into buffer for pfx blob\n", pfxBlob.cbData) ;
printf("Writing pfx file for this certificate store ...\n") ;
FileBinout("migpk12.pfx", pfxBlob.cbData, pfxBlob.pbData) ;
}
The output pfx (pkcs#12) file when double-clicked then should invoke
the standard crypto import dialog (worked for me).
- Mitch
to use the PFXExportCertStoreEx function on the memory store after only one certificate context
is transferred to the memory store.
This works for all certificates except for the one that has the
private key marked as "not exportable" as seen in the IE GUI security panels.
I use the call:
PFXExportCertStoreEx(hMemoryStore, &pfxBlob, "", NULL, EXPORT_PRIVATE_KEYS) )
which should work in all cases, right ? (for no private key, or if private key is not exportable).