<messageSenderAuthentication> 元素

指定用于对等消息发送方的身份验证选项。

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

<system.serviceModel>
  <behaviors>
    <endpointBehaviors>
      <endpointBehaviors> 的 <behavior>
        <clientCredentials>
          <clientCredentials> 的 <peer> 元素
            <messageSenderAuthentication> 元素

<messageSenderAuthentication
customCertificateValidatorType= "namespace.typeName, [,AssemblyName] [,Version=version number] [,Culture=culture] [,PublicKeyToken=token]"
certificateValidationMode = "ChainTrust/None/PeerTrust/PeerOrChainTrust/Custom"
revocationMode="NoCheck/Online/Offline"
trustedStoreLocation="CurrentUser/LocalMachine" 
/>

属性和元素

属性

属性 说明

customCertificateValidatorType

用于验证自定义类型的类型和程序集。当 certificateValidationMode 设置为 Custom 时,必须设置此属性。

certifcateValidationMode

指定用来验证凭据的三种模式之一。如果设置为 Custom,则还必须提供 customCertificateValidator

revocationMode

用于检查吊销证书列表 (CRL) 的一种模式。

trustedStoreLocation

两个系统存储位置之一:LocalMachineCurrentUser。在向客户端协商服务证书时使用此值。将根据指定存储位置中的“受信任人”存储执行验证。

子元素

无。

父元素

元素 说明

<clientCredentials> 的 <peer> 元素

指定一个用于向对等服务证明客户端身份的凭据。

备注

如果选择了消息身份验证,则必须配置此元素。对于输出通道,对每个消息均使用 <certificate> 元素 提供的证书进行签名。在将任一消息传递到应用程序之前,都会使用由此元素的 customCertificateValidatorType 属性指定的验证程序对照消息凭据对其进行检查。验证程序可以接受或拒绝凭据。

示例

下面的代码将消息发送方验证模式设置为 PeerOrChainTrust

<behaviors>
 <endpointBehaviors>
  <behavior name="MyEndpointBehavior">
   <clientCredentials>
    <peer>
      <certificate findValue="www.contoso.com" 
                   storeLocation="LocalMachine"
                   x509FindType="FindByIssuerName" />
        <messageSenderAuthentication 
          certificateValidationMode="PeerOrChainTrust" />
       <messageSenderAuthentication certificateValidationMode="None" />
    </peer>
   </clientCredentials>
  </behavior>
 </endpointBehaviors>

另请参见

参考

X509PeerCertificateAuthentication
MessageSenderAuthentication
MessageSenderAuthentication
X509PeerCertificateAuthenticationElement

其他资源

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