PKCS11证书
Dot NET 是否支持 HSM 设备的 PKCS11 证书。如果没有,是否有其他支持 pkcs11 证书的第三方实用程序?
Does Dot NET supports PKCS11 certificates for HSM devices. If not, are there any other third party utilities available which supports pkcs11 certificates?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
对于 PKCS11,您可以使用开源 Pkcs11Interop。它运行良好,并且包含大量带有使用示例的单元测试。
For PKCS11 you can use open source Pkcs11Interop. It works fine and contains alot of unit tests with examples of usage.
这个库可以满足您的需要:
http://www.ncryptoki.com
This library does what you need:
http://www.ncryptoki.com
不确定“HSM 设备”是什么意思,因此您需要检查您的要求的具体情况。
否则,.NET 确实支持 PKCS9,但在核心 .NET 中没有 PKCS11 的迹象(对于前一个
System.Security.Cryptography.Pkcs
命名空间)。在核心 .NET 之外,有一些搜索命中(例如 http://msdn.microsoft.com/en-us/library/microsoft.clm.shared.profiletemplates.smartcardprovidertype(VS.85).aspx)。
Not sure what you mean by "HSM device", so you will need to check the specifics of your requirements.
Otherwise .NET does support PKCS9, but no sign of PKCS11 in core .NET (for the former
System.Security.Cryptography.Pkcs
namespace).Outside of core .NET there are some search hits (e.g. http://msdn.microsoft.com/en-us/library/microsoft.clm.shared.profiletemplates.smartcardprovidertype(VS.85).aspx).
您可以使用如下语句轻松地从 .net 调用 PKCS11 API:
You can easily call PKCS11 APIs from .net using statements like this:
Windows 和 .NET 由于被签署为 Windows 平台,因此有自己的 PKCS#11 替代方案。
在 .NET 本身中,System.Security.Cryptography 具有密钥存储提供程序的概念,在 Windows 中,有 CryptoAPI 及其加密服务提供程序及其较小的子集,称为专为智能卡设计的微型驱动程序。
在这两种情况下,基于相关加密 API 构建的应用程序都可以访问加密设备,例如与其集成的硬件安全模块。
所有供应商都将提供与这些提供商模型中的一个或多个的集成,以便您可以在不使用 PKCS#11 的情况下使用这些设备(如果您对此感兴趣)。
如果您出于某种原因需要使用 PKCS#11,并且在某些情况下可能需要这样做,您应该查看 https ://www.pkcs11interop.net/,因为它为 HSM 供应商提供的本机 PKCS#11 库提供托管包装器。
如果您沿着这条路线走下去,您可以使用 SoftHSM (https://www.opendnssec.org/softhsm/) 如果您手边没有这样的设备,如果您继续使用 Windows 加密 API,您可以使用 Windows 中包含的虚拟智能卡解决方案进行测试,这将完成近似以下类型的合理工作:使用物理 HSM 时会遇到的问题。
Windows, and .NET by the virtue of it being signed to be a Windows platform, has it's own alternatives to PKCS#11.
In .NET itself there is System.Security.Cryptography that has the concept of Key Storage Providers, in Windows there is CryptoAPI with its Cryptographic Service Providers and its smaller subset called minidrivers designed for Smart Cards.
In both cases applications built on the associated cryptographic APIs get to access cryptographic appliances like Hardware Security Modules that integrate with them.
All vendors will provide integration with one or more of these provider models so you can use these devices without the use of PKCS#11 if that is your interest.
If you need to use PKCS#11 for some reason, and there are cases where that might be needed, you should look at https://www.pkcs11interop.net/ as it provides a managed wrapper for the native PKCS#11 libraries provided by HSM vendors.
If you go down this route you can use SoftHSM (https://www.opendnssec.org/softhsm/) for testing if you don't have such a device handy, if you stay with the Windows cryptographic APIs you can do testing with the Virtual Smart Card solution that is included in Windows and this will do a reasonable job approximating the sort of issues you will have with a physical HSM.
我不是 .NET 专家,但根据 Google PKIblackbox 有一个工具包适用于使用 PCKS#11 的 .NET。然后存在一些 PKCS#11-CSP 包装器,允许通过 CryptoAPI 访问 PKCS#11 模块,因为我认为 .NET 世界有很多助手。其中一个包装器是 CSP11
I'm not a .NET specialist but according to Google PKIblackbox has a toolkit for .NET that speaks PCKS#11. Then there exist some PKCS#11-CSP wrappers which allow to access PKCS#11 modules via CryptoAPI, for what I assume .NET world has many helpers. One of such wrappers is CSP11