次の方法で共有


<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

ユーザー設定タイプの検証に使用されるタイプおよびアセンブリです。certificateValidationModeCustom に設定されている場合は、この属性を設定する必要があります。

certifcateValidationMode

資格情報の検証に使用される 3 つのモードのいずれかを指定します。Custom に設定されている場合、customCertificateValidator も指定する必要があります。

revocationMode

証明書失効リスト (CRL) のチェックに使用されるモードのいずれかです。

trustedStoreLocation

2 つのシステム格納場所 (LocalMachine または CurrentUser) のいずれかです。この値は、サービス証明書がクライアントにネゴシエートされるときに使用されます。指定された格納場所の [信頼されたユーザー] ストアに対して検証が実行されます。

子要素

なし。

親要素

要素 説明

<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