ServiceCredentials.ClientCertificate Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the current client certificate authentication and provisioning settings for this service.
public:
property System::ServiceModel::Security::X509CertificateInitiatorServiceCredential ^ ClientCertificate { System::ServiceModel::Security::X509CertificateInitiatorServiceCredential ^ get(); };
public System.ServiceModel.Security.X509CertificateInitiatorServiceCredential ClientCertificate { get; }
member this.ClientCertificate : System.ServiceModel.Security.X509CertificateInitiatorServiceCredential
Public ReadOnly Property ClientCertificate As X509CertificateInitiatorServiceCredential
Property Value
An X509CertificateInitiatorServiceCredential instance.
Examples
The following code shows how to access this property and use it to set additional properties.
serviceHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.Custom;
serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
new MyX509CertificateValidator("CN=Contoso.com");
serviceHost.Credentials.ClientCertificate.Authentication. _
CertificateValidationMode = X509CertificateValidationMode.Custom
serviceHost.Credentials.ClientCertificate.Authentication. _
CustomCertificateValidator = New MyX509CertificateValidator("CN=Contoso.com")
Remarks
You can specify a client certificate authentication model using the Authentication property. In the mutual certificate duplex scenario, you can specify an X.509 certificate to use in a response or callback using the Certificate property.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈