NetTcpSecurity Classe

Definição

Especifica os tipos de segurança dos níveis de transporte e de mensagem usados por um ponto de extremidade configurado com um NetTcpBinding.Specifies the types of transport-level and message-level security used by an endpoint configured with a NetTcpBinding.

public ref class NetTcpSecurity sealed
public sealed class NetTcpSecurity
type NetTcpSecurity = class
Public NotInheritable Class NetTcpSecurity
Herança
NetTcpSecurity

Exemplos

O código a seguir mostra como recuperar o NetTcpSecurity objeto de um NetTcpBinding e imprime as várias configurações que ele contém:The following code shows how to retrieve the NetTcpSecurity object from a NetTcpBinding and prints out the various settings it contains:

using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
{
    serviceHost.Open();
    ServiceEndpointCollection endpoints = serviceHost.Description.Endpoints;
    ServiceEndpoint endpoint = endpoints.Find(typeof(ICalculator));

    NetTcpBinding binding = (NetTcpBinding) endpoint.Binding;

    NetTcpSecurity security = binding.Security;
    MessageSecurityOverTcp msTcp = security.Message;

    Console.WriteLine("Dumping NetTcpSecurity object:");
    Console.WriteLine("\tMessageSecurityOverTcp:");
    Console.WriteLine("\t\tAlgorithm Suite: {0}", msTcp.AlgorithmSuite);
    Console.WriteLine("\t\tClient Credential Type: {0}", msTcp.ClientCredentialType);

    Console.WriteLine("\tSecurity Mode: {0}", security.Mode);

    TcpTransportSecurity tsTcp = security.Transport;
    Console.WriteLine("\tTcpTransportSecurity:");
    Console.WriteLine("\t\tClient Credential Type: {0}", tsTcp.ClientCredentialType);
    Console.WriteLine("\t\tProtectionLevel: {0}", tsTcp.ProtectionLevel);

    // The service can now be accessed.
    Console.WriteLine("The service is ready.");
    Console.WriteLine("Press <ENTER> to terminate service.");
    Console.WriteLine();
    Console.ReadLine();
}

Comentários

Cada uma das associações padrão fornece parâmetros para controlar os requisitos de segurança de transferência.Each of the standard bindings provides parameters for controlling the transfer security requirements. Esses parâmetros normalmente incluem o modo de segurança que especificou se a segurança no nível de mensagem ou de transporte é usada e a escolha do tipo de credencial do cliente.These parameters typically include the security mode that specified whether message-level or transport-level security is used and the choice of client credential type. Com base na escolha das opções que esses parâmetros apresentam, uma pilha de canais é construída com a segurança apropriada.Based on the choice of options these parameters present, a channel stack is constructed with appropriate security.

As associações fornecidas pelo sistema fornecidas pelo Windows Communication Foundation (WCF) são um conjunto projetado para atender a alguns dos requisitos de cenário mais comuns.The system-provided bindings supplied by Windows Communication Foundation (WCF) are a set designed to meet some of the most common scenario requirements. Cada uma dessas associações permite a especificação de requisitos de segurança para alguns cenários específicos de destino.Each of these bindings allows the specification of security requirements for some specific targeted scenarios.

NetTcpSecurity fornece as especificações de segurança para o NetTcpBinding .NetTcpSecurity provides the security specifications for NetTcpBinding. Essa é uma associação segura, confiável e otimizada adequada para comunicação entre computadores.This is a secure, reliable, optimized binding suitable for cross-machine communication. Por padrão, ele gera uma pilha de comunicação de tempo de execução que dá suporte a TCP para entrega de mensagens e segurança do Windows para segurança e autenticação de mensagens, WS-ReliableMessaging para confiabilidade e codificação de mensagens binárias.By default it generates a run-time communication stack that supports TCP for message delivery and Windows Security for message security and authentication, WS-ReliableMessaging for reliability, and binary message encoding.

Essa classe é instanciada pelo NetTcpBinding e pode ser acessada por uma propriedade somente leitura chamada Security .This class is instantiated by the NetTcpBinding, and can be accessed by a read-only property called Security. Como essa propriedade é somente leitura, você não pode fazer alterações no objeto retornado.Because this property is read-only you cannot make changes to the returned object. Se você quiser controlar a criação do NetTcpSecurity objeto, poderá derivar uma classe de NetTcpBinding .If you want to control the creation of the NetTcpSecurity object, you can derive a class from NetTcpBinding.

Construtores

NetTcpSecurity()

Inicializa uma nova instância da classe NetTcpSecurity.Initializes a new instance of the NetTcpSecurity class.

Propriedades

Message

Obtém o tipo dos requisitos de segurança em nível de mensagem de um serviço configurado com um NetTcpBinding.Gets the type of message-level security requirements for a service configured with a NetTcpBinding.

Mode

Obtém ou define se a segurança de nível de transporte e a segurança de nível de mensagem serão usadas por um ponto de extremidade configurado com um NetTcpBinding.Gets or sets whether message-level security and transport-level security are used by an endpoint configured with a NetTcpBinding.

Transport

Obtém o tipo dos requisitos de segurança em nível de mensagem de um ponto de extremidade configurado com um NetTcpBinding.Gets the type of message-level security requirements for an endpoint configured with a NetTcpBinding.

Métodos

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)

Aplica-se a