SslStream.HashAlgorithm Propriedade

Definição

Obtém o algoritmo usado para gerar códigos de autenticação de mensagens (MACs).

public:
 virtual property System::Security::Authentication::HashAlgorithmType HashAlgorithm { System::Security::Authentication::HashAlgorithmType get(); };
public virtual System.Security.Authentication.HashAlgorithmType HashAlgorithm { get; }
member this.HashAlgorithm : System.Security.Authentication.HashAlgorithmType
Public Overridable ReadOnly Property HashAlgorithm As HashAlgorithmType

Valor de Propriedade

O algoritmo utilizado para gerar códigos de autenticação de mensagens (MACs).

Exceções

A HashAlgorithm propriedade foi acedida antes da conclusão do processo de autenticação ou antes da falha do processo de autenticação.

Exemplos

O exemplo de código seguinte mostra as definições de criptografia para o fluxo especificado.

static void DisplaySecurityLevel(SslStream stream)
{
   Console.WriteLine("Cipher: {0} strength {1}", stream.CipherAlgorithm, stream.CipherStrength);
   Console.WriteLine("Hash: {0} strength {1}", stream.HashAlgorithm, stream.HashStrength);
   Console.WriteLine("Key exchange: {0} strength {1}", stream.KeyExchangeAlgorithm, stream.KeyExchangeStrength);
   Console.WriteLine("Protocol: {0}", stream.SslProtocol);
}
Private Shared Sub DisplaySecurityLevel(stream As SslStream)
    Console.WriteLine("Cipher: {0} strength {1}", stream.CipherAlgorithm, stream.CipherStrength)
    Console.WriteLine("Hash: {0} strength {1}", stream.HashAlgorithm, stream.HashStrength)
    Console.WriteLine("Key exchange: {0} strength {1}", stream.KeyExchangeAlgorithm, stream.KeyExchangeStrength)
    Console.WriteLine("Protocol: {0}", stream.SslProtocol)
End Sub

Observações

Os algoritmos de autenticação de mensagens geram hashes e assinaturas de mensagens usadas para detetar adulteração e falsificação.

Aplica-se a