LocalClientSecuritySettings Classe
Definição
Especifica as configurações de segurança do cliente local.Specifies local client security settings.
public ref class LocalClientSecuritySettings sealed
public sealed class LocalClientSecuritySettings
type LocalClientSecuritySettings = class
Public NotInheritable Class LocalClientSecuritySettings
- Herança
-
LocalClientSecuritySettings
Exemplos
Este exemplo mostra como usar a LocalClientSecuritySettings classe.This example shows how to use the LocalClientSecuritySettings class.
// 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();
Comentários
Essa classe contém as configurações de segurança local usadas pelo SecurityBindingElement (e classes derivadas dela) para criar o canal de segurança.This class contains the local security settings used by the SecurityBindingElement (and classes derived from it) to build the security channel. Essas configurações são locais para o cliente e não são determinadas pela política de segurança do serviço.These settings are local to the client and are not determined from the service's security policy.
Construtores
| LocalClientSecuritySettings() |
Inicializa uma nova instância da classe LocalClientSecuritySettings.Initializes a new instance of the LocalClientSecuritySettings class. |
Propriedades
| CacheCookies |
Obtém ou define um valor que indica se os cookies de conversa segura são armazenados em cache.Gets or sets a value that indicates whether secure conversation cookies are cached. |
| CookieRenewalThresholdPercentage |
Obtém ou define o percentual de limite de renovação de cookies de conversa segura.Gets or sets the threshold percentage for renewal of secure conversation cookies. |
| DetectReplays |
Obtém ou define um valor que indica se a detecção de reprodução está habilitada em mensagens que o cliente recebe do serviço.Gets or sets a value that indicates whether replay detection is enabled on messages the client receives from the service. |
| IdentityVerifier |
Obtém ou define o verificador de identidade.Gets or sets the identity verifier. |
| MaxClockSkew |
Obtém ou define a diferença máxima permitida de tempo entre os relógios do sistema das duas partes que estão se comunicando.Gets or sets the maximum allowable time difference between the system clocks of the two parties that are communicating. |
| MaxCookieCachingTime |
Obtém ou define o tempo máximo de cache para cookies de conversa segura.Gets or sets the maximum caching time for secure conversation cookies. |
| NonceCache |
Obtém ou define o cache para as configurações de segurança do cliente local.Gets or sets the cache for the local client security settings. |
| ReconnectTransportOnFailure |
Obtém ou define um valor que indica se as sessões de segurança tentam se reconectar após falhas de transporte.Gets or sets a value that indicates whether security sessions attempt to reconnect after transport failures. |
| ReplayCacheSize |
Obtém ou define o número de nonces em cache usados para detecção de reprodução.Gets or sets the number of cached nonces used for replay detection. |
| ReplayWindow |
Obtém ou define o tempo máximo pelo qual um nonce da mensagem é válido.Gets or sets the maximum time that a message nonce is valid. |
| SessionKeyRenewalInterval |
Obtém ou define o período após o qual o iniciador renova a chave para a sessão de segurança.Gets or sets the time span after which the initiator renews the key for the security session. |
| SessionKeyRolloverInterval |
Obtém ou define o intervalo de tempo para o qual a chave da sessão anterior é válida nas mensagens de entrada durante uma renovação de chave.Gets or sets the time interval for which the previous session key is valid on incoming messages during a key renewal. |
| TimestampValidityDuration |
Obtém ou define a duração máxima pela qual as mensagens são válidas quando enviadas pelo cliente.Gets or sets the maximum duration that the messages are valid when sent by the client. Se uma mensagem for recebida pelo serviço após esta duração, ele deverá descartar a mensagem.If a message is received by the service after this duration, it should discard the message. |
Métodos
| Clone() |
Cria uma nova instância dessa classe, que é uma cópia ou um clone da instância atual.Creates a new instance of this class, which is a copy or clone of the current instance. |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |