Condividi tramite


SslStream.CipherAlgorithm Proprietà

Definizione

Attenzione

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

Ottiene un valore che identifica l'algoritmo di crittografia bulk utilizzato da questo SslStreamoggetto .

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

Valore della proprietà

Valore che identifica l'algoritmo di crittografia bulk utilizzato da questo SslStreamoggetto .

Attributi

Eccezioni

È CipherAlgorithm stato eseguito l'accesso alla proprietà prima del completamento del processo di autenticazione o del processo di autenticazione non riuscito.

Esempio

Nell'esempio di codice seguente vengono visualizzate le impostazioni di crittografia per il flusso specificato.

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

Commenti

Un valore di è obbligatorio per la CipherAlgorithm proprietà quando viene usato il NoEncryption valore di Null enumerazione per costruire un'istanzaSslStream.

Windows Server 2003 e Windows XP non supportano il Null valore . Pertanto, anche se il Null valore viene usato per costruire l'istanza SslStream , la EncryptionPolicy proprietà sarà None. Il Null valore viene restituito solo in Windows Vista e versioni successive.

Si applica a