Share via


LocalServiceSecuritySettings 클래스

정의

설정할 수 있는 로컬 서비스 보안 속성을 제공합니다.

public ref class LocalServiceSecuritySettings sealed
public sealed class LocalServiceSecuritySettings
type LocalServiceSecuritySettings = class
Public NotInheritable Class LocalServiceSecuritySettings
상속
LocalServiceSecuritySettings

예제

다음 예제에서는 LocalServiceSecuritySettings 클래스를 사용하여 DetectReplays 설정을 변경하는 방법을 보여 줍니다.

    // 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 colllection.
    // Important: Cast to the SymmetricSecurityBindingElement when using the Find
    // method.
    SymmetricSecurityBindingElement sbe = (SymmetricSecurityBindingElement)
bec.Find<SecurityBindingElement>();

    // Get the LocalServiceSettings from the binding element.
    LocalServiceSecuritySettings lss = sbe.LocalServiceSettings;

    // Print out values.
    Console.WriteLine("DetectReplays: {0} days", lss.DetectReplays);
    Console.WriteLine("ReplayWindow: {0} minutes", lss.ReplayWindow.Minutes);
    Console.WriteLine("MaxClockSkew: {0} minutes", lss.MaxClockSkew.Minutes);

    Console.ReadLine();
    Console.WriteLine("Press Enter to Continue");
    // Change the MaxClockSkew to 3 minutes.
    lss.MaxClockSkew = new TimeSpan(0, 0, 3, 0);

    // Print the new value.
    Console.WriteLine("New MaxClockSkew: {0} minutes", lss.MaxClockSkew.Minutes);
    Console.WriteLine("Press Enter to End");
    Console.ReadLine();

    // Create a URI for the service.
    Uri httpUri = new Uri("http://localhost/calculator");

    // Create a ServiceHost. The binding has the changed MaxClockSkew.
    ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);
    sh.AddServiceEndpoint(typeof(ICalculator), b, "");
    // sh.Open();
    // Console.WriteLine("Listening");
    // Console.ReadLine();
    // sh.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 colllection.
' Important: Cast to the SymmetricSecurityBindingElement when using the Find
' method.
Dim sbe As SymmetricSecurityBindingElement = CType(bec.Find(Of SecurityBindingElement)(), SymmetricSecurityBindingElement)

' Get the LocalServiceSettings from the binding element.
Dim lss As LocalServiceSecuritySettings = sbe.LocalServiceSettings

' Print out values.
Console.WriteLine("DetectReplays: {0} days", lss.DetectReplays)
Console.WriteLine("ReplayWindow: {0} minutes", lss.ReplayWindow.Minutes)
Console.WriteLine("MaxClockSkew: {0} minutes", lss.MaxClockSkew.Minutes)

Console.ReadLine()
Console.WriteLine("Press Enter to Continue")
' Change the MaxClockSkew to 3 minutes.
lss.MaxClockSkew = New TimeSpan(0, 0, 3, 0)

' Print the new value.
Console.WriteLine("New MaxClockSkew: {0} minutes", lss.MaxClockSkew.Minutes)
Console.WriteLine("Press Enter to End")
Console.ReadLine()

' Create a URI for the service.
Dim httpUri As New Uri("http://localhost/calculator")

' Create a ServiceHost. The binding has the changed MaxClockSkew.
Dim sh As New ServiceHost(GetType(Calculator), httpUri)
sh.AddServiceEndpoint(GetType(ICalculator), b, "")
' sh.Open();
' Console.WriteLine("Listening");
' Console.ReadLine();
' sh.Close();

설명

이 클래스에는 SecurityBindingElement에서 보안 채널을 생성하는 데 사용되는 로컬 보안 설정이 포함되어 있습니다. 이러한 설정은 서비스에 국한되며 서비스의 보안 정책에 표시되지 않습니다.

생성자

LocalServiceSecuritySettings()

LocalServiceSecuritySettings 클래스의 새 인스턴스를 초기화합니다.

속성

DetectReplays

서비스에서 재생 검색을 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다.

InactivityTimeout

비활성 상태가 지속될 때 채널을 닫기 전에 대기하는 기간을 가져오거나 설정합니다.

IssuedCookieLifetime

서비스에서 클라이언트에 발급하는 SecurityContextSecurityToken에 대한 수명을 가져오거나 설정합니다.

MaxCachedCookies

서비스에서 한 번에 캐시할 수 있는 최대 SecurityContextSecurityToken 수를 가져오거나 설정합니다.

MaxClockSkew

서로 통신하는 양쪽 시스템 클록 간에 허용되는 최대 시간 차이를 가져오거나 설정합니다.

MaxPendingSessions

서버에서 세션 토큰을 발급한 후 애플리케이션 메시지가 발송되지 않은 상태로 유지할 수 있는 서버에 대해 설정된 최대 동시 보안 세션 수를 가져오거나 설정합니다.

MaxStatefulNegotiations

서비스에서 참여할 수 있는 클라이언트와의 최대 동시 보안 협상 수를 가져오거나 설정합니다.

NegotiationTimeout

클라이언트와 서비스 간 보안 협상 단계의 최대 시간을 가져오거나 설정합니다.

NonceCache

로컬 서비스 보안 설정에 대한 캐시를 가져오거나 설정합니다.

ReconnectTransportOnFailure

보안 세션에서 전송 실패 후 다시 연결을 시도하는지 여부를 나타내는 값을 가져오거나 설정합니다.

ReplayCacheSize

재생 검색에 사용되는 Nonce 캐시의 크기를 가져오거나 설정합니다.

ReplayWindow

서비스에서 메시지를 수락할 수 있는 최대 시간을 가져오거나 설정합니다.

SessionKeyRenewalInterval

보안 세션에 사용되는 키의 수명을 가져오거나 설정합니다. 이 간격이 만료되면 키가 자동으로 갱신됩니다.

SessionKeyRolloverInterval

키 갱신 중 들어오는 메시지에 대해 이전의 세션 키가 유효성을 유지하는 키 갱신 시간 간격을 가져오거나 설정합니다.

TimestampValidityDuration

서비스에서 메시지를 보낼 때 메시지가 유효성을 유지하는 최대 기간을 가져오거나 설정합니다. 클라이언트는 이 기간 후에 서비스 메시지를 받으면 메시지를 삭제합니다.

메서드

Clone()

현재 인스턴스에서 이 클래스의 새 인스턴스를 만듭니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상