本文整理汇总了C#中Certificate.ToX509Certificate方法的典型用法代码示例。如果您正苦于以下问题:C# Certificate.ToX509Certificate方法的具体用法?C# Certificate.ToX509Certificate怎么用?C# Certificate.ToX509Certificate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Certificate
的用法示例。
在下文中一共展示了Certificate.ToX509Certificate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExcludePrivateKeyTest
public void ExcludePrivateKeyTest(Certificate target)
{
target.ExcludePrivateKey();
Assert.False(target.ToX509Certificate().HasPrivateKey);
}
示例2: TestForPrivateKeyExistence
public void TestForPrivateKeyExistence(Certificate cert)
{
X509Certificate2 cert2 = cert.ToX509Certificate();
Assert.True(cert2.HasPrivateKey);
}
示例3: ToPublicX509CertificateTest
public void ToPublicX509CertificateTest(Certificate target)
{
target.ExcludePrivateKey();
X509Certificate2 cert = target.ToX509Certificate();
Assert.False(cert.HasPrivateKey);
}
示例4: ToX509CertificateTest
public void ToX509CertificateTest(Certificate target)
{
X509Certificate2 expected = new DisposableX509Certificate2(target.ToX509Certificate().GetRawCertData());
X509Certificate2 actual = target.ToX509Certificate();
Assert.Equal(expected, actual);
}