<defaultCertificate> 元素

指定在服务或 STS 未通过协商协议提供证书时要使用的 X.509 证书。

架构层次结构

<system.serviceModel>
  <behaviors>
    <endpointBehaviors>
      <endpointBehaviors> 的 <behavior>
        <clientCredentials>
          <serviceCredentials> 的 <serviceCertificate>
            <defaultCertificate> 元素

语法

<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" />

属性和元素

以下几节描述了特性、子元素和父元素

属性

特性 说明

findValue

字符串。要搜索的值。

x509FindType

枚举。要搜索的证书字段之一。

storeLocation

枚举。要搜索的两个系统存储位置之一。

storeName

枚举。要搜索的系统存储之一。

子元素

无。

父元素

元素 说明

<clientCredentials> 的 <serviceCertificate> 元素

指定客户端对服务进行身份验证时使用的证书。

备注

对于使用基于证书的消息安全的绑定,此配置元素指定的证书用于加密发送给服务的消息,并期望服务用它来对客户端的应答进行签名。如果服务未指定任何证书,它只存储要使用的一个证书。

示例

下面的示例指定了两个证书,一个证书用于 URI 以 https://www.contoso.com 开头的终结点,另一个证书用于不执行证书协商的所有其他终结点。

<serviceCertificate>
  <defaultCertificate findValue="www.contoso.com" 
                      storeLocation="LocalMachine"
                      storeName="TrustedPeople" 
                      x509FindType="FindByIssuerDistinguishedName" />
  <scopedCertificates>
     <add targetUri="https://www.contoso.com" 
          findValue="www.contoso.com" storeLocation="LocalMachine"
                  storeName="Root" x509FindType="FindByIssuerName" />
  </scopedCertificates>
  <authentication revocationMode="Online" 
   trustedStoreLocation="LocalMachine" />
</serviceCertificate>

另请参见

参考

<clientCertificate> 的 <authentication> 元素
X509DefaultServiceCertificateElement
X509CertificateRecipientClientCredential
DefaultCertificate

其他资源

Working with Certificates
Securing Clients
Securing Services and Clients