SslStream.CipherStrength 属性

定义

获取一个值,该值确定此 SslStream 使用的密码算法的强度。Gets a value that identifies the strength of the cipher algorithm used by this 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

Int32 值,该值指定算法的强度(以位为单位)。An Int32 value that specifies the strength of the algorithm, in bits.

示例

下面的代码示例显示指定流的加密设置。The following code example displays the cryptography settings for the specified stream.

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

注解

在进行身份验证之前,此属性的值为零。The value of this property is zero until the authentication occurs.

此属性返回以下值之一:This property returns one of the following values:

  • 00

  • 4040

  • 5656

  • 8080

  • 128128

  • 168168

  • 192192

  • 256256

适用于