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

限于喜欢 提交于 2021-02-19 08:23:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/37002314/cant-import-pfx-to-microsoft-sample-key-storage-provider-cryptographic-provide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!