我需要为 Windows Phone 应用程序使用证书客户端 .pkcs12。我不能使用 X509Certificate 类,因为不允许使用 PKCS12。所以我下载了 BouncyCastle 类并制作了这个
try
{
FileStream Cert = new FileStream
("certificate.pkcs12",FileMode.Open,FileAccess.Read);
char[] password = new char[] { 'p','a','s','s','w','o','r','d' };
Pkcs12Store certificate = new Pkcs12Store(Cert,password);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
我得到这个例外:
{System.TypeInitializationException:
The type initializer for 'Org.BouncyCastle.Asn1.Pkcs.PkcsObjectIdentifiers'
threw an exception. --->
System.IO.FileNotFoundException: Could not load file or assembly