共用方式為


<clientCredentials> 項目的 <clientCertificate>

定義對服務驗證用戶端時使用的 X.509 憑證。

<<system.serviceModel>>
  <behaviors>
    <endpointBehaviors>
      <endpointBehaviors> 的 <behavior>
        <clientCredentials>
          <clientCredentials> 項目的 <clientCertificate>

<clientCertificate findValue="String" 
    storeLocation="LocalMachine/CurrentUser"
    storeName="AddressBook/AuthRoot/CertificateAuthority/Disallowed/My/Root/TrustedPeople/TrustedPublisher"
X509FindType="FindByThumbPrint/FindBySubjectName/FindBySubjectDistinguishedName/FindByIssuerName/FindByIssuerDistinguishedName/FindBySerialNumber/FindByTimeValid/FindByTimeNotYetValid/FindByTemplateName/FindByApplicationPolicy/FindByCertificatePolicy/FindByExtension/FindByKeyUsage/FindBySubjectKeyIdentifier"
/>

屬性和項目

屬性

屬性 描述

findValue

字串,其中包含要在 X.509 憑證存放區內搜尋的值。這個屬性所包含的型別必須滿足 X509FindType 屬性值的需求。預設為空字串。

storeLocation

指定 X.509 憑證的位置,用戶端會使用該憑證來進行對服務的自我驗證。有效值包括以下的值:

  • LocalMachine:指派給本機電腦的憑證存放區。
  • CurrentUser:指派給目前使用者的憑證存放區。

預設為 LocalMachine。此屬性的型別為 StoreLocation

storeName

指定要搜尋之 X.509 憑證存放區的名稱。有效值包括以下的值:

  • AddressBook:其他使用者的憑證存放區。
  • AuthRoot:協力廠商憑證授權單位 (CA) 的憑證存放區。
  • CertificateAuthority:中繼憑證授權單位 (CA) 的憑證存放區。
  • Disallowed:已撤銷之憑證的憑證存放區。
  • My:個人憑證的憑證存放區。
  • Root:信任之根憑證授權單位 (CA) 的憑證存放區。
  • TrustedPeople:直接信任之人員和資源的憑證存放區。
  • TrustedPublisher:直接信任之發行者的憑證存放區。

預設為 My。此屬性的型別為 StoreName

X509FindType

定義要執行之 X.509 搜尋的類型。findValue 屬性中所包含的型別必須滿足此屬性的需求。有效值包括以下的值:

  • FindByThumbPrint
  • FindBySubjectName
  • FindBySubjectDistinguishedName
  • FindByIssuerName
  • FindByIssuerDistinguishedName
  • FindBySerialNumber
  • FindByTimeValid
  • FindByTimeNotYetValid
  • FindByTemplateName
  • FindByApplicationPolicy
  • FindByCertificatePolicy
  • FindByExtension
  • FindByKeyUsage
  • FindBySubjectKeyIdentifier

預設值為 FindBySubjectDistinguishedName。此屬性的型別為 X509FindType

子項目

無。

父項目

項目 描述

<clientCredentials>

指定用來對服務驗證用戶端的認證。

備註

這個組態項目會指定憑證,此憑證會用來驗證具有這個項目的用戶端。如需詳細資訊,請參閱 How to: Specify Client Credential Values

請參閱

參考

ClientCredentialsElement
ClientCertificate
ClientCredentials
ClientCertificate
X509InitiatorCertificateServiceElement
X509CertificateInitiatorClientCredential

其他資源

Security Behaviors in WCF
How to: Specify Client Credential Values
Securing Clients
Working with Certificates
Securing Services and Clients