如何使用Microsoft Crypto API与USB加密狗PKCS#11 [英] how to use Microsoft Crypto API with USB Dongle following PKCS#11

查看:542
本文介绍了如何使用Microsoft Crypto API与USB加密狗PKCS#11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个公司提供的safenet身份验证usb令牌,他们告诉我他们有数字公钥证书。他们给了我一个密码和一个软件,我可以看到它可以检测证书里面。现在我需要访问这个令牌的证书,然后我需要使用签名,加密和解密使用我的开发代码。但公司没有给我任何sdk所以我必须做的一切C ++微软CryptoAPI。我在google上搜索,但我不知道我是否正确的方向

I have safenet authentication usb token which was given by a company and they told me they have digital public key certificate inside. They gave me a password and a software by which i can see that it can detect certificate inside. Now i need to access this token's certificate and then i need to use signing , encryption and decryption using my development code. But the company didn't gave me any sdk so i have to do everything by C++ Microsoft CryptoAPI. I searched on google but i am not sure if i am on right direction

这个代码不给我正确的处理usb存储证书

this code doesn't give me correct handle for the usb stored certificate

        // Attempt to acquire a handle to the default key container.
        bResult = CryptAcquireContext(
                    &hProv,            // Variable to hold returned handle.
                    NULL,              // Use default key container.
                    MS_DEF_PROV,       // Use default CSP.
                    PROV_RSA_FULL,     // Type of provider to acquire.
        0);             

我认为它应该提供任何默认连接的证书在智能卡或令牌。我尝试MS_SCARD_PROV以及思考,如果它会给我访问通过usb令牌,但它似乎只是为智能卡不是令牌。

i thought it should give any default connected certificate either its on smart card or token. I tried MS_SCARD_PROV as well in thought if it will give me access through usb token but it seems like its just for the smart card not for token.

我绝望完成这个任务请指导我或显示正确的教程,如果你的专家知道任何。或者建议我应该为这样的任务做什么。

I am desperate to complete this task please guide me or show me correct tutorial if you experts know any. Or suggest me what should be done for such kind of task..

推荐答案

您将使用PKCS#11和CryptoAPI功能。

you will be using both PKCS#11 and CryptoAPI functionalities.

PKCS#11将主要用于与硬件令牌通信。每个硬件供应商都会为其硬件令牌实施PKCS#11接口。如果你的etoken,那么safenet有一个。此外,safenet还会使用其

PKCS#11 will be primarily used to talk to the hardware token. Every hardware vendor would have implemented a PKCS#11 interface for their hardware token. If your's is etoken,then safenet has one. Also safenet will have their CryptoAPI CSP that you can use to talk to the token.

CryptoAPI提供丰富的功能来处理令牌中存在的证书。

CryptoAPI provides rich functionality to handle certificates that are present with in the token.

这篇关于如何使用Microsoft Crypto API与USB加密狗PKCS#11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆