<scopedCertificates> 項目的 <add>

將 X.509 憑證新增至範圍憑證的集合。

<<system.serviceModel>>
  <behaviors>
    <endpointBehaviors>
      <endpointBehaviors> 的 <behavior>
        <clientCredentials>
          <serviceCredentials> 的 <serviceCertificate>
            <scopedCertificates> 項目
              <scopedCertificates> 項目的 <add>

<add findValue="String"
          storeLocation="CurrentUser/LocalMachine"
          storeName=" CurrentUser/LocalMachine"
          targetUri="string"
         x509Type="FindByThumbprint/FindBySubjectName/FindBySubjectDistinguishedName/FindByIssuerName/FindByIssuerDistinguishedName/FindBySerialNumber/FindByTimeValid/FindByTimeNotYetValid/FindBySerialNumber/FindByTimeExpired/FindByTemplateName/FindByApplicationPolicy/FindByCertificatePolicy/FindByExtension/FindByKeyUsage/FindBySubjectKeyIdentifier" 
/> 

屬性和項目

屬性

屬性 描述

targetUri

字串。指定與憑證相關聯的服務之 URI。

findValue

字串。要搜尋的值。

x509FindType

列舉。要搜尋的其中一個憑證欄位。

storeLocation

列舉。搜尋兩個存放位置中的一個。

storeName

列舉。搜尋的其中一個系統存放區。

子項目

無。

父項目

項目 描述

<scopedCertificates> 項目

表示特定服務 (範圍服務) 為驗證所提供之 X.509 憑證的集合。

備註

這個項目可讓用戶端根據與其進行通訊之服務的 URL 設定要使用的服務憑證。在用戶端可以與多重服務 (終端服務以及中繼安全性權杖服務) 進行通訊的已核發權杖情況中,這個屬性特別有用。對於使用以憑證為基礎之訊息安全性的繫結,這個憑證會用來加密傳送給服務的訊息,而且預期會被服務用來簽署對用戶端的回覆。

如果繫結需要服務的憑證,但是在 ScopedCertificates 中找不到服務 URL 的專屬憑證,則會使用預設的憑證。

如需詳細資訊,請參閱 How To: Create a Federated Client的<範圍憑證>一節。

範例

下列範例會將 X.509 憑證新增至集合。

<behaviors>
 <endpointBehaviors>
  <behavior name="MyEndpointBehavior">
   <clientCredentials>
    <serviceCertificate>
     <scopedCertificates>
      <add targetUri="https://www.contoso.com" 
       findValue="www.Contoso.com" 
       storeLocation="LocalMachine"
       storeName="Root" 
       x509FindType="FindByIssuerName" />
     </scopedCertificates>
    </serviceCertificate>
   </clientCredentials>
  </behavior>
 </endpointBehaviors>
</behaviors>

請參閱

參考

ScopedCertificates
X509ScopedServiceCertificateElementCollection
X509ScopedServiceCertificateElement
X509CertificateRecipientClientCredential
ScopedCertificates

其他資源

How To: Create a Federated Client
Working with Certificates
Securing Clients
Securing Services and Clients