当前位置: 动力学知识库 > 问答 > 编程问答 >

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

问题描述:

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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: