本文整理匯總了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;