JFYI: on 3 computers with 3 tokens which are supposed to be supported (Eutron, Rainbow, Aladdin) we couldn't manage this piece of open-source to even start correctly. On two computers it gave various errors when trying to read the devices and on my system it fails to load the PKCS11 module due to problems in resolving the dependencies between various libraries. Firefox fails too.

I added some code to check the private key and apparently it's not there.

Most of the tokens do not allow export of private keys, so SaveKeyToBuffer is not a right way to check the existence of the private key. Please check if Sign method throws some error.

BTW, how exactly did you add the OpenSC PKCS#11 module to Firefox? Firefox shows an 'Unable to add module' error for us. It would be excellent if you specify the exact steps you used to build the module and the exact version of Firefox that understood it.

No error is thrown by the Sign method, but the output buffer is empty.

As for Firefox , I just went into Tools -> Options -> Advanced -> Security Devices, then I clicked on 'Load' and entered a name for the OpenSC PKCS11 module and the path of the PKCS11 library.
After that it loaded it without any problem and I could see the status changing as I inserted/removed the card in the reader.
I used the latest SCB (Smart Card Bundle) for Windows that you can find on OpenSC's website.
The Firefox version is 2.0.0.9.

Simone Ferrari wrote:
As for Firefox , I just went into Tools -> Options -> Advanced -> Security Devices, then I clicked on 'Load' and entered a name for the OpenSC PKCS11 module and the path of the PKCS11 library.
After that it loaded it without any problem and I could see the status changing as I inserted/removed the card in the reader.
I used the latest SCB (Smart Card Bundle) for Windows that you can find on OpenSC's website.
The Firefox version is 2.0.0.9.

You are lucky. On my system Firefox 2 says "can't load library" for opensc-pkcs11.dll from the same package that you have used. And the problem is in unresolved ordinals. OpenSC uses linkage by ordinal to some libraries (winsock 2, openssl) and this is a very bad idea usually as the numbers can change. As it happened on my system.

Simone Ferrari wrote:
As for Firefox , I just went into Tools -> Options -> Advanced -> Security Devices, then I clicked on 'Load' and entered a name for the OpenSC PKCS11 module and the path of the PKCS11 library.
After that it loaded it without any problem and I could see the status changing as I inserted/removed the card in the reader.
I used the latest SCB (Smart Card Bundle) for Windows that you can find on OpenSC's website.
The Firefox version is 2.0.0.9.

You are lucky. On my system Firefox 2 says "can't load library" for opensc-pkcs11.dll from the same package that you have used. And the problem is in unresolved ordinals. OpenSC uses linkage by ordinal to some libraries (winsock 2, openssl) and this is a very bad idea usually as the numbers can change. As it happened on my system.

I don't know what to say. I guess OpenSC is not implemented that well.
However, I have now found PKCS11 modules for my card that the producer gives out with the card, so at least these should work. One of them is IpmPKI32.dll.

I have tried this with your component and it works fine regarding the loading of the library and determining the slots etc... Even reading the certificate details works all right. But like I mentioned earlier I'm not able to sign. Can you help me on this one?

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.