本文整理匯總了C#中Org.BouncyCastle.Pkix.PkixCertPath.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# PkixCertPath.Equals方法的具體用法?C# PkixCertPath.Equals怎麽用?C# PkixCertPath.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Org.BouncyCastle.Pkix.PkixCertPath
的用法示例。
在下文中一共展示了PkixCertPath.Equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PerformTest
public override void PerformTest()
{
X509CertificateParser cf = new X509CertificateParser();
X509Certificate rootCert = cf.ReadCertificate(rootCertBin);
X509Certificate interCert = cf.ReadCertificate(interCertBin);
X509Certificate finalCert = cf.ReadCertificate(finalCertBin);
//Testing CertPath generation from List
IList list = new ArrayList();
list.Add(interCert);
// CertPath certPath1 = cf.generateCertPath(list);
PkixCertPath certPath1 = new PkixCertPath(list);
//Testing CertPath encoding as PkiPath
byte[] encoded = certPath1.GetEncoded("PkiPath");
//Testing CertPath generation from InputStream
MemoryStream inStream = new MemoryStream(encoded, false);
// CertPath certPath2 = cf.generateCertPath(inStream, "PkiPath");
PkixCertPath certPath2 = new PkixCertPath(inStream, "PkiPath");
//Comparing both CertPathes
if (!certPath2.Equals(certPath1))
{
Fail("CertPath differ after encoding and decoding.");
}
encoded = certPath1.GetEncoded("PKCS7");
//Testing CertPath generation from InputStream
inStream = new MemoryStream(encoded, false);
// certPath2 = cf.generateCertPath(inStream, "PKCS7");
certPath2 = new PkixCertPath(inStream, "PKCS7");
//Comparing both CertPathes
if (!certPath2.Equals(certPath1))
{
Fail("CertPath differ after encoding and decoding.");
}
encoded = certPath1.GetEncoded("PEM");
//Testing CertPath generation from InputStream
inStream = new MemoryStream(encoded, false);
// certPath2 = cf.generateCertPath(inStream, "PEM");
certPath2 = new PkixCertPath(inStream, "PEM");
//Comparing both CertPathes
if (!certPath2.Equals(certPath1))
{
Fail("CertPath differ after encoding and decoding.");
}
//
// empty list test
//
list = new ArrayList();
// CertPath certPath = CertificateFactory.GetInstance("X.509","BC").generateCertPath(list);
PkixCertPath certPath = new PkixCertPath(list);
if (certPath.Certificates.Count != 0)
{
Fail("list wrong size.");
}
//
// exception tests
//
doTestExceptions();
}