<messageSenderAuthentication>

指定消息发送方使用的对等证书的身份验证设置。

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <serviceBehaviors> 的 <behavior>
        <serviceCredentials>
          <serviceCredentials> 的 <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" 
/>

属性和元素

属性

属性 说明

certificateValidationMode

可选的枚举。指定用来验证凭据的三种模式之一。此属性的类型为 X509CertificateValidationMode。如果设置为 Custom,则还必须提供 customCertificateValidator

customCertificateValidatorType

可选的字符串。指定用于验证自定义类型的类型和程序集。当 certificateValidationMode 设置为 Custom 时,必须设置此属性。此属性的类型为 X509CertificateValidator。Windows Communication Foundation (WCF) 提供一个默认的对等证书验证程序,该程序根据受信任的用户存储区来验证对等证书。它还验证证书是否与有效的根相联系。您可以实现自定义验证程序以指定不同的行为,并使用该属性指向自定义验证程序。

revocationMode

可选的枚举。指定证书吊销模式。此属性的类型为 X509RevocationMode。系统通过在吊销证书列表中进行查找来验证对等证书尚未吊销。可以联机执行该检查,也可以根据缓存的吊销列表执行该检查。将此属性设置为 NoCheck 可禁用吊销检查。

trustedStoreLocation

可选的枚举。指定 WCF 安全系统用来验证对等证书的受信任存储区位置。此属性的类型为 StoreLocation

子元素

无。

父元素

元素 说明

<serviceCredentials> 的 <peer>

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

备注

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

另请参见

参考

X509PeerCertificateAuthenticationElement
X509PeerCertificateAuthentication
MessageSenderAuthentication
MessageSenderAuthentication

其他资源

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