Hi,
I am using Pkcs11X509Store (0.2.0.0) with .Net Framework 4.7.2 and trying to initialize the instance but I got the error "Unable to load 64-bit unmanaged library into 32-bit runtime" do you have any idea or suggestion on that ?
I only wanted to load the certificate stored in my HSM.
string libPath = @"C:\Program Files\SafeNet\LunaClient\cryptoki.dll";
using (var store = new Pkcs11X509Store(libPath, new PinProvider("111111")))
{
Pkcs11X509Certificate cert = store.Slots[0].Token.Certificates[0];
}
and here is my PinProvider Class
public class PinProvider : IPinProvider
{
private byte[] _pin = null;
public PinProvider(string pin)
{
_pin = Encoding.UTF8.GetBytes(pin);
}
public GetPinResult GetKeyPin(Pkcs11X509StoreInfo storeInfo, Pkcs11SlotInfo slotInfo, Pkcs11TokenInfo tokenInfo, Pkcs11X509CertificateInfo certificateInfo)
{
return new GetPinResult(false, false, _pin);
}
public GetPinResult GetTokenPin(Pkcs11X509StoreInfo storeInfo, Pkcs11SlotInfo slotInfo, Pkcs11TokenInfo tokenInfo)
{
return new GetPinResult(false, false, _pin);
}
}
Update : I changed to load the dll in 32-bit I got this error "Value of attribute CKA_ALWAYS_AUTHENTICATE could not be read"
Hi, I am using Pkcs11X509Store (0.2.0.0) with .Net Framework 4.7.2 and trying to initialize the instance but I got the error "Unable to load 64-bit unmanaged library into 32-bit runtime" do you have any idea or suggestion on that ? I only wanted to load the certificate stored in my HSM.
and here is my PinProvider Class
Update : I changed to load the dll in 32-bit I got this error "Value of attribute CKA_ALWAYS_AUTHENTICATE could not be read"