次の方法で共有


<peerAuthentication> 要素

ピアツーピア クライアントの認証オプションを指定します。

ピアツーピア プログラミング詳細情報、「Peer to Peer Networking」を参照してください。

スキーマの階層

<system.serviceModel>
  <behaviors>
    <endpointBehaviors>
      <endpointBehaviors> の <behavior>
        <clientCredentials>
          <clientCredentials> 要素の <peer>
            <peerAuthentication> 要素

構文

<peerAuthentication
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 も指定する必要があります。既定値は ChainTrust です。

revocationMode

省略可能な列挙体です。証明書失効リスト (CRL) のチェックに使用されるモードのいずれかを指定します。既定値は Online です。

trustedStoreLocation

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

子要素

なし。

親要素

要素 説明

<clientCredentials> 要素の <peer>

ピア サービスに対するクライアントの認証に使用される資格情報を指定します。

解説

<authentication> 要素は、X509PeerCertificateAuthentication クラスに対応します。この要素は、メッシュ内の近隣ノード間の認証時に呼び出される検証コントロールを指定します。新しいピアが近隣ノードとの接続を確立しようとするとき、自身の資格情報を応答側のピアに渡します。リモート パーティの資格情報を検証するために、応答側の検証が呼び出されます。メッシュ内でピア接続が確立されるたびに、両方のピアが相互に認証されます。つまり、双方の検証が呼び出されます。

次のコードは、証明書検証モードを PeerOrChainTrust に設定します。

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

参照

リファレンス

PeerCredentialElement
X509PeerCertificateAuthentication
PeerAuthentication
PeerAuthentication
X509PeerCertificateAuthenticationElement

その他のリソース

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