解决方法
AFAIK,证书不能通过XML格式保存,您应该自己组合.
这是你想要的吗?
static void Main(string[] args) { X509Certificate2 cer = new X509Certificate2(); cer.Import(@"D:\l.cer"); X509Store store = new X509Store(StoreLocation.CurrentUser); store.Certificates.Add(cer); X509Certificate2Collection cers = store.Certificates.Find(X509FindType.FindBySubjectName,"My Cert's Subject Name",false); if (cers.Count>0) { cer = cers[0]; }; store.Close(); }