指定在安全令牌服务(STS)未通过协商协议提供证书时要使用的 X.509 证书。
<配置>
<system.serviceModel>
<行为>
<endpointBehaviors>
<行为>
<clientCredentials>
<serviceCertificate>
<defaultCertificate>
Syntax
<defaultCertificate findValue="String"
storeLocation=" CurrentUser/LocalMachine"
storeName="AddressBook/AuthRoot/CertificateAuthority/Disallowed/My/Root/TrustedPeople/TrustedPublisher"
x509FindType="FindByThumbPrint/FindBySubjectName/FindBySubjectDistinguishedName/FindByIssuerName/FindByIssuerDistinguishedName/FindBySerialiNumber/FindByTimeValid/FindByTimeNotYetValid/FindByTimeExpired/FindByTemplateName/FindByApplicationPolicy/FindByCertificatePolicy/FindByExtension/FindByKeyUsage/FindBySubjectKeyIdentifier" />
属性和元素
以下部分介绍属性、子元素和父元素
特性
| Attribute | Description |
|---|---|
| findValue | String. 要搜索的值。 |
| x509FindType | 列举。 要搜索的证书字段之一。 |
| storeLocation | 列举。 要搜索的两个系统存储位置之一。 |
| storeName | 列举。 要搜索的系统存储之一。 |
findValue 属性
| 价值 | Description |
|---|---|
| String | 该值取决于要搜索的字段(由 X509FindType 属性指定)。 例如,如果搜索指纹,该值必须是十六进制数字的字符串。 |
x509FindType 属性
| 价值 | Description |
|---|---|
| Enumeration | 值包括:FindByThumbprint、FindBySubjectName、FindBySubjectDistinguishedName、 FindByIssuerName、FindByIssuerDistinguishedName、FindBySerialNumber、FindByTimeValid、FindByTimeNotYetValid、FindBySerialNumber、FindByTimeExpired、FindByTemplateName、FindByApplicationPolicy、FindByCertificatePolicy、FindByExtension、FindByKeyUsage、FindBySubjectKeyIdentifier。 |
storeLocation 属性
| 价值 | Description |
|---|---|
| Enumeration | CurrentUser 或 LocalMachine。 |
storeName 属性
| 价值 | Description |
|---|---|
| Enumeration | 值包括:AddressBook、AuthRoot、CertificateAuthority、不允许、My、Root、TrustedPeople 和 TrustedPublisher。 |
子元素
没有。
父元素
| 元素 | Description |
|---|---|
| <serviceCertificate> | 指定在向客户端验证服务时要使用的证书。 |
注解
对于使用基于证书的消息安全性的绑定,此配置元素指定的证书用于对服务的消息进行加密,服务预期会用于对客户端的答复进行签名。 它存储一个证书,用于在服务未指定任何证书时使用。
Example
以下示例指定要用于其 URI 开头的终结点的 http://www.contoso.com 证书,以及用于不执行证书协商的所有其他终结点的证书。
<serviceCertificate>
<defaultCertificate findValue="www.contoso.com"
storeLocation="LocalMachine"
storeName="TrustedPeople"
x509FindType="FindByIssuerDistinguishedName" />
<scopedCertificates>
<add targetUri="http://www.contoso.com"
findValue="www.contoso.com"
storeLocation="LocalMachine"
storeName="Root"
x509FindType="FindByIssuerName" />
</scopedCertificates>
<authentication revocationMode="Online"
trustedStoreLocation="LocalMachine" />
</serviceCertificate>