Compartir por


SslStream.CipherAlgorithm Propiedad

Definición

Precaución

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

Obtiene un valor que identifica el algoritmo de cifrado masivo utilizado por este 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

Valor de propiedad

Valor que identifica el algoritmo de cifrado masivo usado por este SslStream.

Atributos

Excepciones

Se CipherAlgorithm obtuvo acceso a la propiedad antes de que se complete el proceso de autenticación o se produjo un error en el proceso de autenticación.

Ejemplos

En el ejemplo de código siguiente se muestra la configuración de criptografía de la secuencia especificada.

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

Comentarios

Se requiere un valor de Null para la CipherAlgorithm propiedad cuando se usa el NoEncryption valor de enumeración para construir una SslStream instancia.

Windows Server 2003 y Windows XP no admiten el Null valor. Por lo tanto, aunque el Null valor se use para construir la SslStream instancia, la EncryptionPolicy propiedad será None. El Null valor solo se devuelve en Windows Vista y versiones posteriores.

Se aplica a