Hello, and first of all excuses in advance if the question is already solved.
I have tried to read a big amount of messages in the forum and search, but I am newbie with cryptotoken and maybe I have not well searched.
The matter is that I am trying to extract private key from a smartcard and sign a pdf doc with it. First question is : it is possible? As far as I have read it is, but ...
And concerning pkcs#11/cryptoapi, I am trying to use now the last one and can not find a sample (only pkcs#11). Is there any based on cryptoapi? If not, which are the main differences of the classes in order to modify the pkcs#11 one?
Thanks in advance and kindest regards.

You can't extract the private key from the smartcard. You can use it for PDF signing, though.

Quote

Cesar Calvo wrote:
And concerning pkcs#11/cryptoapi, I am trying to use now the last one and can not find a sample (only pkcs#11). Is there any based on cryptoapi? If not, which are the main differences of the classes in order to modify the pkcs#11 one?

Thanks again for a very quick answer (Fantastic support!!!)
But I realized that (maybe because of my ignorance in this area), I have not explained very well what I would like to do.
I would like to sign the pdf doc with the private certificate of the smart card. As smartcard reader uses crytoapi for windows, I think I should use access to this storage using ElWinCertStorage.(right?)
After that, maybe I should use the Clone method of ElX509Certificate to copy this certificate, or maybe using the certificate object directly to sign the pdf.
It is possible? Is there any example of using EIWinCertStorage?
Regards

Cesar Calvo wrote:
I would like to sign the pdf doc with the private certificate of the smart card. As smartcard reader uses crytoapi for windows, I think I should use access to this storage using ElWinCertStorage.(right?)­

Yes.

Quote

Cesar Calvo wrote:
After that, maybe I should use the Clone method of ElX509Certificate to copy this certificate, or maybe using the certificate object directly to sign the pdf.

Create an instance of ElMemoryCertStorage class and add the chosen certificate to this instance. Then use the instance of ElMemoryCertStorage with ElPDFSigner. When you add the certificate, it's actually copied, but the copy knows, where it was taken from, so it will use the smartcard.

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.