http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=207279&SiteID=1
From what I understand from the above link is that the Private Key of the certificate stored in SmartCard is not easily readable.
You will have to enter PIN to be able to extract the PrivateKey from the certificate.
As explained in that forum, one of the techniques would be to use Win32 API, CryptAcquireCertificatePrivateKey , from Crypto32.dll.
Another technique would be to construct the RSACryptoServiceProvider with CspParameters structure which contains the name of the smart card CSP.
Try it out and let us know if it is working. I don't have SmartCard reader so I have not tested this solution.
Hope it gives you some idea to get started.
Maung Maung
As I was unable to use X509Certificate2 for signing from a SC I tried your suggestion about using a lower level API, so I have used the following code:CspParameters CSPParam = new CspParameters();CSPParam.KeyContainerName = "MY";CSPParam.ProviderName = DATAKEY_RSA_SCARD_PROV; //Smart card CSP//"Datakey class="iAs">RSA CSP"CSPParam.ProviderType = (int)CryptoCom.PROV_RSA_FULL;CSPParam.KeyNumber = 2; // (int)KeyNumber.Signature;RSACryptoServiceProvider Key = new RSACryptoServiceProvider(CSPParam);Now comes the surprise, this code works perfectly on Visual studio 2003, but trying to use the same code, with the same smartcard and the sameCSP on visual studio 2005 I got also the error:"More class="iAs">data is available". Anyone knows what is the problem?If there is no solution for that problem, is somebody knows how can I use.net 1.1 instead of .net 2.0 on Visual Studio 2005 please let me know.Thanks a lot in advance.