<scopedCertificates> 元素

表示特定服务为身份验证提供的 X.509(作用域)证书的集合。此集合通常用于指定联合方案中安全令牌服务的服务证书。

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

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

属性和元素

属性

无。

子元素

元素 说明

<scopedCertificates> 的 <add> 元素

向作用域证书集合添加 X.509 证书。

父元素

元素 说明

<serviceCredentials> 的 <serviceCertificate>

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

备注

此集合使客户端能够根据与它通信的服务的 URL 来配置要使用的服务证书。这在已颁发令牌的方案中尤其有用,在这些方案中,客户端可与多个服务(终端服务以及中间的安全令牌服务)进行通信。对于使用基于证书的消息安全的绑定,此证书用于加密发送给服务的消息,并期望服务用它来对客户端的应答进行签名。

如果绑定需要服务的证书,但在 ScopedCertificates 中未找到服务 URL 的特定证书,则使用默认证书。

有关更多信息,请参见How To: Create a Federated Client的“作用域证书”部分。

示例

下面的示例指定一个服务证书,以便供客户端在通过 HTTP 协议与域名为 https://www.contoso.com 的终结点通信时使用。

<serviceCertificate>
  <scopedCertificates>
     <add targetUri="https://www.contoso.com" 
          findValue="www.contoso.com" storeLocation="LocalMachine"
                  storeName="Root" x509FindType="FindByIssuerName" />
  </scopedCertificates>
</serviceCertificate>

另请参见

参考

<scopedCertificates> 的 <add> 元素
ScopedCertificates
X509ScopedServiceCertificateElementCollection
X509ScopedServiceCertificateElement
X509CertificateRecipientClientCredential
ScopedCertificates

其他资源

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