<peer> 的 <certificate>

指定对等方使用的证书。

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <serviceBehaviors> 的 <behavior>
        <serviceCredentials>
          <serviceCredentials> 的 <peer>
            <peer> 的 <certificate>

<certificate findValue = "String" 
storeLocation = "CurrentUser/LocalMachine"
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。

storeName

指定要打开的 X.509 证书存储的名称。包括以下有效值:

  • AddressBook:其他用户的证书存储。
  • AuthRoot:第三方证书颁发机构 (CA) 的证书存储。
  • CertificateAuthority:中间证书颁发机构 (CA) 的证书存储。
  • Disallowed:吊销的证书的证书存储。
  • My:个人证书的证书存储。
  • Root:受信任的根证书颁发机构 (CA) 的证书存储。
  • TrustedPeople:直接受信任的人和资源的证书存储。
  • TrustedPublisher:直接受信任的发行者的证书存储。

默认值为 My。

X509FindType

定义要执行的 X.509 搜索的类型。包括以下有效值:

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

findValue 属性中包含的类型必须满足指定 X509FindType 的要求。

默认值为 FindBySubjectDistinguishedName。

子元素

无。

父元素

元素 说明

<serviceCredentials> 的 <peer>

指定对等节点的当前凭据。

备注

此配置元素包含对对等网格中的邻居进行身份验证时使用的 X509Certificate2 实例。

有关对等编程的更多信息,请参见Peer to Peer Networking

另请参见

参考

PeerCredentialElement
Certificate
X509PeerCertificateElement
Certificate
PeerCredential

其他资源

Working with Certificates
Peer to Peer Networking
Peer Channel Message Authentication
Peer Channel Custom Authentication
Best Practices for Securing PeerChannel Applications
Securing Services and Clients