I'm trying to execute samples provided with "Cryptographic Provider Development Kit"; in this case an example specifically called KeyStorageProviderSample. In this sample, a new Key Storage Provider called "Microsoft Sample Key Storage Provider" is created in the system simply by executing the .exe with the -register param:
At this point everything is ok; if I list the KSPs in the system I get the complete list:
The one just created, "Microsoft Sample Key Storage Provider" is listed. However, when I try to import a PFX certificate into it, it doesn't work:
Certutil -CSP "Microsoft Sample Key Storage Provider" -user -importPFX "mycert.pfx"
I get a 0x80090009 error. The same command executed against "Microsoft Software Key Storage Provider" works perfectly. It seems that the KSP created in this sample lacks from something that "Microsoft Software Key Storage Provider" has.
What do I need to create my own KSP? I'm using Windows 7 Professional.
I think the reason if because the Sample KSP uses a custom structure (
SAMPLEKSP_KEY) for storing the key, and not a PFX compatible one, for instance a