IChannelCredentials インターフェイス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
サービス プロキシ上の特定のセキュリティ機能の設定を許可するインターフェイス。
public interface class IChannelCredentials
[System.Runtime.InteropServices.Guid("181b448c-c17c-4b17-ac6d-06699b93198f")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIDispatch)]
public interface IChannelCredentials
[<System.Runtime.InteropServices.Guid("181b448c-c17c-4b17-ac6d-06699b93198f")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIDispatch)>]
type IChannelCredentials = interface
Public Interface IChannelCredentials
- 属性
例
monString = "service:mexAddress=http://localhost:8000/ServiceModelSamples/Service?wsdl"
monString = monString + ", address=http://localhost:8000/ServiceModelSamples/Service"
monString = monString + ", binding=BasicHttpBinding_ICalculator, bindingNamespace=http://Microsoft.ServiceModel.Samples"
monString = monString + ", contract=ICalculator, contractNamespace=http://Microsoft.ServiceModel.Samples"
Set monikerProxy = GetObject(monString)
'Set the Service Certificate.
monikerProxy.ChannelCredentials.SetServiceCertificateAuthentication "CurrentUser", "NoCheck", "PeerOrChainTrust"
monikerProxy.ChannelCredentials.SetDefaultServiceCertificateFromStore "CurrentUser", "TrustedPeople", "FindBySubjectName", "localhost"
'Set the Client Certificate.
monikerProxy.ChannelCredentials.SetClientCertificateFromStoreByName "CN=client.com", "CurrentUser", "My"
MsgBox monikerProxy.Add(3, 4)
注釈
アンマネージド クライアントは、"サービス" モニカーを使用して、Windows Communication Foundation (WCF) サービスにアクセスします。 これらのクライアントは、COM セキュリティ モデルではなく WCF セキュリティ モデルの対象となります。 IChannelCredentials インターフェイスは、チャネル資格情報を指定するために提供されます。 これは、COM モニカーがマネージド WCF セキュリティ オブジェクト モデルにアクセスできないために必要です。
チャネルの作成後、 IChannelCredentials インターフェイスでメソッドを呼び出すのは適していません。 これは、Windows Communication Foundation (WCF) は、既に開いているチャネルでのセキュリティ設定の変更をサポートしていないためです。 サービス モニカー クライアントがプロキシを取得するとき、チャネルはまだ作成されていません。 したがって、クライアントは、サービス メソッドを呼び出す前に IChannelCredentials メソッドを呼び出す必要があります。 サービス メソッドの呼び出し後にクライアントが IChannelCredentials メソッドを呼び出すと、例外RPC_E_TOO_LATEがスローされます。
メソッド
| 名前 | 説明 |
|---|---|
| SetClientCertificateFromFile(String, String, String) |
ファイルから証明書を取得し、クライアント資格情報に追加します。 |
| SetClientCertificateFromStore(String, String, String, Object) |
証明書ストアから証明書を取得し、クライアント資格情報に追加します。 |
| SetClientCertificateFromStoreByName(String, String, String) |
証明書ストアから証明書を名前で取得し、クライアント資格情報に追加します。 |
| SetDefaultServiceCertificateFromFile(String, String, String) |
ファイルから証明書を取得し、既定の証明書としてサービス資格情報に追加します。 |
| SetDefaultServiceCertificateFromStore(String, String, String, Object) |
証明書ストアから証明書を取得し、既定の証明書としてサービス資格情報に追加します。 |
| SetDefaultServiceCertificateFromStoreByName(String, String, String) |
証明書ストアから証明書を名前で取得し、既定の証明書としてサービス資格情報に追加します。 |
| SetIssuedToken(String, String, String) |
発行されたトークンのパラメーターを設定します。 |
| SetServiceCertificateAuthentication(String, String, String) |
サービス証明書の認証パラメーターを設定します。 |
| SetUserNameCredential(String, String) |
ユーザー名の資格情報を設定します。 |
| SetWindowsCredential(String, String, String, Int32, Boolean) |
Windows資格情報を設定します。 |