i've got some issue on reading certificates from a new smart card with a BluDrive II card reader. With old smart card no problem, but with the newest no certificate are discovered inside the card. With bit4id software i'm able to read all the cards (with all the information that i need).
X509SecurityToken securityToken = null;
var store = new X509Store();
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadOnly);
try
{
Console.WriteLine("CERTIFICATI PRESENTI: {0}",store.Certificates.Count);
X509Certificate2Collection certs = (X509Certificate2Collection)store.Certificates;
if (certs.Count > 0)
{
int i = 1;
foreach (var cert in certs)
{
securityToken = new X509SecurityToken(cert);
Console.WriteLine(".................................................................");
Console.WriteLine("CERTIFICATO {0}:\n\n {1}",i++, securityToken.Certificate);
}
}
else
{
Console.WriteLine("NESSUN CERTIFICATO LETTO");
securityToken = null;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally
{
if (store != null)
store.Close();
}
I'm novice of this place, i hope in your help, thanks a lot in advance :-) Ces@re