指定了无效的提供程序类型

X509Certificate2 pc = new X509Certificate2(pfxPath, pfxPwd);

                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.PreserveWhitespace = true;
                xmlDoc.LoadXml(xml);
                SignedXml xmlSig = new SignedXml(xmlDoc);
                xmlSig.SigningKey = pc.PrivateKey;
这段代码抛异常了,调试的时候发现在声明pc的时候,私钥那一项就出异常了:“pc.PrivateKey”引发了“System.Security.Cryptography.CryptographicException”类型的异常。不知道什么原因,可以获得公钥,路径跟密码都没有问题
哪位大神可以解答下啊

http://blog.csdn.net/ikmb/article/details/5849839
http://blog.sina.com.cn/s/blog_6c8d95c101012j79.html