Поделиться через


SslStream.CipherAlgorithm Свойство

Определение

Внимание

KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.

Возвращает значение, определяющее алгоритм массового шифрования, используемый этим SslStreamметодом.

public:
 virtual property System::Security::Authentication::CipherAlgorithmType CipherAlgorithm { System::Security::Authentication::CipherAlgorithmType get(); };
[System.Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId="SYSLIB0058", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual System.Security.Authentication.CipherAlgorithmType CipherAlgorithm { get; }
public virtual System.Security.Authentication.CipherAlgorithmType CipherAlgorithm { get; }
[<System.Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId="SYSLIB0058", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.CipherAlgorithm : System.Security.Authentication.CipherAlgorithmType
member this.CipherAlgorithm : System.Security.Authentication.CipherAlgorithmType
Public Overridable ReadOnly Property CipherAlgorithm As CipherAlgorithmType

Значение свойства

Значение, определяющее алгоритм массового шифрования, используемый этим SslStream.

Атрибуты

Исключения

Свойство CipherAlgorithm было выполнено до завершения процесса проверки подлинности или сбой процесса проверки подлинности.

Примеры

В следующем примере кода отображаются параметры шифрования для указанного потока.

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

Комментарии

Значение Null требуется для свойства, если NoEncryption значение перечисления используется для CipherAlgorithm создания экземпляраSslStream.

Windows Server 2003 и Windows XP не поддерживают Null значение. Таким образом, даже если Null значение используется для создания экземпляра SslStream , EncryptionPolicy свойство будет None. Значение Null возвращается только в Windows Vista и более поздних версиях.

Применяется к