共用方式為


SslStream.CipherStrength 屬性

定義

取得值,識別這個 SslStream 所用之加密演算法的強度。

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

屬性值

Int32 值,指定演算法的強度 (以位元為單位)。

範例

下列程式代碼範例會顯示指定數據流的密碼編譯設定。

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

備註

這個屬性的值是零,直到驗證發生為止。

此屬性會傳回下列其中一個值:

  • 0

  • 40

  • 56

  • 80

  • 128

  • 168

  • 192

  • 256

適用於