SslStream.CipherAlgorithm Właściwość

Definicja

Pobiera wartość identyfikującą algorytm szyfrowania zbiorczego używany przez ten SslStreamelement .

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

Wartość właściwości

Wartość identyfikującą algorytm szyfrowania zbiorczego używany przez ten SslStreamelement .

Wyjątki

Dostęp CipherAlgorithm 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

Wartość elementu jest wymagana Null dla CipherAlgorithm właściwości, gdy NoEncryption wartość wyliczenia jest używana do konstruowania SslStream wystąpienia.

Systemy Windows Server 2003 i Windows XP nie obsługują Null wartości. Więc nawet jeśli Null wartość jest używana do konstruowania SslStream wystąpienia, EncryptionPolicy właściwość będzie mieć wartość None. Wartość Null jest zwracana tylko w systemie Windows Vista i nowszych.

Dotyczy