本文整理汇总了C#中System.ServiceModel.Security.X509CertificateValidationMode枚举的典型用法代码示例。如果您正苦于以下问题:C# X509CertificateValidationMode枚举的具体用法?C# X509CertificateValidationMode怎么用?C# X509CertificateValidationMode使用的例子?那么, 这里精选的枚举代码示例或许可以为您提供帮助。
在下文中一共展示了X509CertificateValidationMode枚举的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
ChannelFactory<ISimpleChannel> cf =
new ChannelFactory<ISimpleChannel>();
cf.Credentials.ClientCertificate.SetCertificate(
StoreLocation.CurrentUser, StoreName.My,
X509FindType.FindByThumbprint,
"37 28 05 09 22 81 07 08 a0 cd 2a af dd c3 83 cd c3 3b 8f 9d");
cf.Credentials.ServiceCertificate.SetDefaultCertificate(
StoreLocation.CurrentUser,
StoreName.TrustedPeople,
X509FindType.FindByThumbprint,
"33 93 68 cc 7c 75 80 24 a2 80 9f 45 8c 81 fa 92 ad 5b 04 39");
cf.Credentials.ServiceCertificate.Authentication.CertificateValidationMode
= X509CertificateValidationMode.PeerOrChainTrust;