LocalClientSecuritySettings クラス

定義

ローカル クライアントのセキュリティ設定を指定します。

public ref class LocalClientSecuritySettings sealed
public sealed class LocalClientSecuritySettings
type LocalClientSecuritySettings = class
Public NotInheritable Class LocalClientSecuritySettings
継承
LocalClientSecuritySettings

この例では、 LocalClientSecuritySettings クラスの使用方法を示します。

// Create an instance of the binding to use.
WSHttpBinding b = new WSHttpBinding();

// Get the binding element collection.
BindingElementCollection bec = b.CreateBindingElements();

// Find the SymmetricSecurityBindingElement in the collection.
// Important: Cast to the SymmetricSecurityBindingElement when using the Find
// method.
SymmetricSecurityBindingElement sbe = (SymmetricSecurityBindingElement)
    bec.Find<SecurityBindingElement>();

// Get the LocalSecuritySettings from the binding element.
LocalClientSecuritySettings lc = sbe.LocalClientSettings;

// Print out values.
Console.WriteLine("Maximum cookie caching time: {0} days", lc.MaxCookieCachingTime.Days);
Console.WriteLine("Replay Cache Size: {0}", lc.ReplayCacheSize);
Console.WriteLine("ReplayWindow: {0} minutes", lc.ReplayWindow.Minutes);
Console.WriteLine("MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes);
Console.ReadLine();

// Change the MaxClockSkew to 3 minutes.
lc.MaxClockSkew = new TimeSpan(0, 0, 3, 0);

// Print the new value.
Console.WriteLine("New MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes);
Console.ReadLine();

// Create an EndpointAddress for the service.
EndpointAddress ea = new EndpointAddress("http://localhost/calculator");

// Create a client. The binding has the changed MaxClockSkew.
// CalculatorClient cc = new CalculatorClient(b, ea);
// Use the new client. (Not shown.)
// cc.Close();
' Create an instance of the binding to use.
Dim b As New WSHttpBinding()

' Get the binding element collection.
Dim bec As BindingElementCollection = b.CreateBindingElements()

' Find the SymmetricSecurityBindingElement in the collection.
' Important: Cast to the SymmetricSecurityBindingElement when using the Find
' method.
Dim sbe As SymmetricSecurityBindingElement = CType(bec.Find(Of SecurityBindingElement)(), SymmetricSecurityBindingElement)

' Get the LocalSecuritySettings from the binding element.
Dim lc As LocalClientSecuritySettings = sbe.LocalClientSettings

' Print out values.
Console.WriteLine("Maximum cookie caching time: {0} days", lc.MaxCookieCachingTime.Days)
Console.WriteLine("Replay Cache Size: {0}", lc.ReplayCacheSize)
Console.WriteLine("ReplayWindow: {0} minutes", lc.ReplayWindow.Minutes)
Console.WriteLine("MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes)
Console.ReadLine()

' Change the MaxClockSkew to 3 minutes.
lc.MaxClockSkew = New TimeSpan(0, 0, 3, 0)

' Print the new value.
Console.WriteLine("New MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes)
Console.ReadLine()

' Create an EndpointAddress for the service.
Dim ea As New EndpointAddress("http://localhost/calculator")

' Create a client. The binding has the changed MaxClockSkew.
' CalculatorClient cc = new CalculatorClient(b, ea);
' Use the new client. (Not shown.)
' cc.Close();

注釈

このクラスには、セキュリティ チャネルを構築するために SecurityBindingElement (およびそこから派生したクラス) によって使用されるローカル セキュリティ設定が含まれています。 これらの設定はクライアントに対してローカルであり、サービスのセキュリティ ポリシーからは決定されません。

コンストラクター

名前 説明
LocalClientSecuritySettings()

LocalClientSecuritySettings クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
CacheCookies

セキュリティで保護された会話 Cookie がキャッシュされるかどうかを示す値を取得または設定します。

CookieRenewalThresholdPercentage

セキュリティで保護された会話 Cookie の更新のしきい値の割合を取得または設定します。

DetectReplays

クライアントがサービスから受信したメッセージで再生検出が有効かどうかを示す値を取得または設定します。

IdentityVerifier

ID 検証ツールを取得または設定します。

MaxClockSkew

通信している 2 つのパーティのシステム クロック間の許容される最大時間差を取得または設定します。

MaxCookieCachingTime

セキュリティで保護された会話 Cookie の最大キャッシュ時間を取得または設定します。

NonceCache

ローカル クライアントのセキュリティ設定のキャッシュを取得または設定します。

ReconnectTransportOnFailure

トランスポートエラーの後にセキュリティ セッションが再接続を試みるかどうかを示す値を取得または設定します。

ReplayCacheSize

再生検出に使用されるキャッシュされた nonce の数を取得または設定します。

ReplayWindow

メッセージ nonce が有効な最大時間を取得または設定します。

SessionKeyRenewalInterval

イニシエーターがセキュリティ セッションのキーを更新する期間を取得または設定します。

SessionKeyRolloverInterval

キーの更新中に受信メッセージで前のセッション キーが有効な時間間隔を取得または設定します。

TimestampValidityDuration

クライアントによって送信されたときにメッセージが有効になる最大期間を取得または設定します。 この期間が経過した後にサービスがメッセージを受信した場合は、メッセージを破棄する必要があります。

メソッド

名前 説明
Clone()

現在のインスタンスのコピーまたは複製である、このクラスの新しいインスタンスを作成します。

Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください