Bagikan melalui


SslStream.CipherStrength Properti

Definisi

Mendapatkan nilai yang mengidentifikasi kekuatan algoritma sandi yang digunakan oleh ini SslStream.

public:
 virtual property int CipherStrength { int get(); };
public virtual int CipherStrength { get; }
member this.CipherStrength : int
Public Overridable ReadOnly Property CipherStrength As Integer

Nilai Properti

Nilai Int32 yang menentukan kekuatan algoritma, dalam bit.

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 properti ini adalah nol sampai autentikasi terjadi.

Properti ini mengembalikan salah satu nilai berikut:

  • 0

  • 40

  • 56

  • 80

  • 128

  • 168

  • 192

  • 256

Berlaku untuk