Click here to Skip to main content
15,889,817 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello to everyone,

how can I do to extract private key from smartcard?

Thank you very much,
Riccardo.
Posted

1 solution

You don't.
That's the whole idea: it's a private key

And even if it was, you wouldn't get such an answer here: there is no legitimate reason for needing that information, and there are a lot on malicious reasons. I would recommend that you drop this line of questioning, and investigation: you will likely attract the interest of international fraud investigations departments.

We do not condone, support or assist in the production of malicious code in any way, form or manner. This is a professional site for professional developers.

If you want to know how to do such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
 
Share this answer
 
Comments
Riccardo Macaluso 17-Jun-15 3:53am    
Thank you for your answer. I have to implement a program to digitally sign XML files with CADes-BES to get ".p7m" files, but I can't do this. I found an example with CNSAPI and I thought that was possible extract smartcard certificate...

Anyway, thank you very much for your help.
OriginalGriff 17-Jun-15 4:19am    
You're welcome!
I didn't think you were up to anything nefarious (so I didn't start the process of removing your account) but you wouldn't believe some of the idiots we get asking questions here. :laugh:

And I know nothing about p7m files - if that's what you need help with, then asking a new question about "digitally signing...etc." explaining what you really need help with and what you've tried might get better results. ;)
Hamassss 18-Jun-15 4:52am    
Sign XML with CADES-BES ? Are you sure you are to use CADES since Valid XML signature format according to http://www.etsi.org/ for XML is XaDeS which is advanced xml electronic signature ? But nontheless, Point of smart cards is that you should never be able to get private key, even if you are owner, you can just use it VIA PIN to sign files with its private key.
Now it is possible to extract smartcard certificate, but not with its private key ofc, so you can still have cert with public key and subject info extracted if you provide PIN for smartcard. CADES standard is extended version of CMS pkcs 7 standard of PKI infrastructure and it does not require private key in signed file AFAIK. I done Xades signing using smartcards but not CMS or CADES but it should not be any big diffrence.
Hamassss 18-Jun-15 4:59am    
And as original griff stated you can make new question with more details of problem so we can see how we can help you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900