Tell me the X509Certificate2 class is thread-safe? Conditionally, I can use it in this way:
public class MyClass
{
// example
private static readonly X509Certificate2 staticCertInstance =
new X509Certificate2("cert.pfx");
// the method can be called from different threads
public void Execute()
{
// use staticCertInstance
}
}
To avoid creating an instance every time, thereby reducing the load on the GC ?