Friday, 4 October 2013

Knowing if need for smartcard on certificate

To know if the private key lives in hardware (usually smartcard) without Windows popping up a message such as "please insert smartcard".

RSACryptoServiceProvider rsa = myX509Instance.PrivateKey as RSACryptoServiceProvider; // problem here
if(rsa.CspKeyContainerInfo.HardwareDevice)
{
     // needs for some hardware..
}

No comments:

Post a Comment