//cert is an EF Entity and // cert.CertificatePKCS12 is a byte[] with the certificate. var certificate = new X509Certificate(cert.CertificatePKCS12, \"SomePassw
Use this code:
certificate = new X509Certificate2(System.IO.File.ReadAllBytes(p12File) , p12FilePassword , X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);