Error no. 48 when using Virtual HSM

6/21/2013 12:30:26 PM
Gravatar
Total Posts 7

Error no. 48 when using Virtual HSM

Hi

I'm using Virtual HSM for testing. My system is a Windows 2008 64bit, but I installed vcki as 32bit because my application is 32bit as well.

First I imported my certificate with private key from Windows certificate store into Virtual HSM following the instructions here: http://wiki.ncryptoki.com/How-to-import-a-pfx-or-a-p12-file.ashx

The file "Virtual Smart Card Reader.bin" was created in ProgramData.

Then I compiled FullTestNDigitSign as 32bit.

When I try to sign a text with FullTestNDigitSign, I must first chose my certificate and then I get an error no 48 at line

SignedDocument sd = dsign.Sign(Encoding.Default.GetBytes(textToSign.Text), new SimpleCertificateSelector());

When I'm using a real HSM instead of Virtual HSM it is working fine.

I guess I'm having a problem with the imported certificate and key (it is a self-signed certificate used for testing). 

Any idea what goes wrong?

Thank you and kind regards

Thomas

6/26/2013 9:40:58 AM
Gravatar
Total Posts 7

Re: Error no. 48 when using Virtual HSM

Issue is solved. Following strictly the instructions here: http://wiki.ncryptoki.com/How-to-import-a-pfx-or-a-p12-file.ashx and IMPORTING FROM FILE works fine. I tried to import from Windows Certificate Store, which failed (maybe due to export restrictions?).