共用方式為


<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