Can't import PFX to Microsoft Sample Key Storage Provider (Cryptographic Provider Development Kit)

1

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:

symmclient -register

At this point everything is ok; if I list the KSPs in the system I get the complete list:

symmclient -enum

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.

Thanks.

c++
c
cryptography
asked on Stack Overflow May 3, 2016 by Jorge Torres • edited May 3, 2016 by Peter David Carter

1 Answer

0

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 _BCRYPT_RSAKEY_BLOB.

answered on Stack Overflow Jun 22, 2016 by Abel Pereira

User contributions licensed under CC BY-SA 3.0