Bagikan melalui


SslStream.CipherAlgorithm Properti

Definisi

Mendapatkan nilai yang mengidentifikasi algoritma enkripsi massal yang digunakan oleh ini SslStream.

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

Nilai Properti

Nilai yang mengidentifikasi algoritma enkripsi massal yang digunakan oleh ini SslStream.

Pengecualian

Properti CipherAlgorithm diakses sebelum proses autentikasi selesai atau proses autentikasi gagal.

Contoh

Contoh kode berikut menampilkan pengaturan kriptografi untuk aliran yang ditentukan.

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

Keterangan

Nilai Null diperlukan untuk CipherAlgorithm properti ketika NoEncryption nilai enumerasi digunakan untuk membuat SslStream instans.

Windows Server 2003 dan Windows XP tidak mendukung nilai.Null Jadi, bahkan jika Null nilai digunakan untuk membuat SslStream instans, EncryptionPolicy properti akan menjadi None. Nilai Null hanya dikembalikan pada Windows Vista dan yang lebih baru.

Berlaku untuk