I am trying to create X509Certificate2 using a string private_keyusing the following code:
byte[] key = Convert.FromBase64String(private_key);
X509Certificate2 certificate = new X509Certificate2(key);
When the last line is executed, the following exception is thrown:
System.Security.Cryptography.CryptographicException Cannot find the requested object
Does anyone know how to solve this?
source
share