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
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);
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..