SslStream.HashAlgorithm Właściwość

Definicja

Pobiera algorytm używany do generowania kodów uwierzytelniania komunikatów (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

Wartość właściwości

Algorytm używany do generowania kodów uwierzytelniania komunikatów (MACs).

Wyjątki

Dostęp HashAlgorithm do właściwości nastąpił przed ukończeniem procesu uwierzytelniania lub proces uwierzytelniania zakończył się niepowodzeniem.

Przykłady

Poniższy przykład kodu wyświetla ustawienia kryptografii dla określonego strumienia.

static void DisplaySecurityLevel( SslStream^ stream )
{
   Console::WriteLine( L"Cipher: {0} strength {1}", stream->CipherAlgorithm, stream->CipherStrength );
   Console::WriteLine( L"Hash: {0} strength {1}", stream->HashAlgorithm, stream->HashStrength );
   Console::WriteLine( L"Key exchange: {0} strength {1}", stream->KeyExchangeAlgorithm, stream->KeyExchangeStrength );
   Console::WriteLine( L"Protocol: {0}", stream->SslProtocol );
}
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

Uwagi

Algorytmy uwierzytelniania komunikatów generują skróty komunikatów i podpisy używane do wykrywania manipulacji i fałszowania.

Dotyczy