共用方式為


SslStream.KeyExchangeStrength 屬性

定義

取得值,識別這個執行個體所用之金鑰交換演算法的強度。

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

屬性值

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

範例

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

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

備註

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

在常見的案例中,此屬性的值是下列其中一項:

  • 512

  • 768

  • 1024

  • 2048

適用於