How to retrieve the private key of a certificate?

private string PrivateKey(X509Certificate2 certificate)
{
string pk;
if (certificate.PrivateKey != null)
{
RSACryptoServiceProvider rsaProvider = certificate.PrivateKey as RSACryptoServiceProvider;
pk = rsaProvider.CspKeyContainerInfo.UniqueKeyContainerName;
}
return pk;
}

Comments

Popular posts from this blog

Network Security: LAN manager authentication level

Cisco AnyConnect Secure Mobility Client - VPN service not available. The VPN agent service is not responding