如何通过 CryptoAPI 访问 etoken?
我正在开发一个 html 应用程序,用户必须首先使用他的数字证书登录。登录后,他必须使用他的数字证书对数据进行加密和解密。 现在,如果证书以 .pfx 文件的形式提供,那么我们只需安装它,证书就会出现在容器中,我们可以在登录期间以及加密和解密期间使用它。 如果我们的数字证书有 .pfx,则此方法可以正常工作。 但现在我想增强它的 etoken(安全令牌)。我对etoken不太了解。问题是如何在登录时使用其中存储的数字证书? 另外,在解密时我应该如何使用其中存储的私钥?
谁能告诉我有关解释 etoken 和 CryptoAPI 用法的教程(如果有)。
I am developing an html application where an user has to first login using his digital certificate. After login he has to perform encryption and decryption of data using his digital certificate.
Now in case when the certificate is available in the form of .pfx file then we can just install it and the certificate appears in the container and we can use it during login and during encryption and decryption.
This works fine in case if we have .pfx for our digital certificate.
But now i want to enhance it for etoken's(security token). I dont know much about etoken's. The problem is that how can i use the digital certificate stored in it while login?
Also how should i use the private key stored in it while decryption?
Can anyone please tell me about any tutorials (if any) which will explain the usage of etoken and the CryptoAPI's.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我在回答您上一个问题时提到的,Windows CSP 将证书从硬件映射到 Windows 证书存储,因此这对您来说是透明的。如果您可以通过Windows证书存储API访问证书,那么您不需要关心证书的实际位置。
请注意,您无法将私钥传输到服务器,即您必须使用客户端模块(ActiveX 或 Java 小程序)在本地执行操作。这不仅针对硬件上的证书,还针对具有不可导出私钥的证书。
As I mentioned in the answer to your previous question, Windows CSPs map the certificate from hardware to Windows certificate storage, so this is transparent to you. If you can access the certificate via Windows certificate storage API, then you don't need to care where the certificate is actually located.
Note that you can't transfer a private key to the server, i.e. you would have to use a client-side module (either ActiveX or Java applet) that will perform operations locally. This is not specific to certificates on hardware, but also to certificates which have non-exportable private keys.