SslStream.CipherAlgorithm Propriedade

Definição

Obtém um valor que identifica o algoritmo de criptografia em massa usado por este SslStream.

public:
 virtual property System::Security::Authentication::CipherAlgorithmType CipherAlgorithm { System::Security::Authentication::CipherAlgorithmType get(); };
public virtual System.Security.Authentication.CipherAlgorithmType CipherAlgorithm { get; }
member this.CipherAlgorithm : System.Security.Authentication.CipherAlgorithmType
Public Overridable ReadOnly Property CipherAlgorithm As CipherAlgorithmType

Valor da propriedade

CipherAlgorithmType

Um valor que identifica o algoritmo de criptografia em massa usado por isso SslStream.

Exceções

A propriedade CipherAlgorithm foi acessada antes da conclusão do processo de autenticação ou o processo de autenticação falhou.

Exemplos

O exemplo de código a seguir exibe as configurações de criptografia do fluxo especificado.

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

Comentários

Um valor é Null necessário para a CipherAlgorithm propriedade quando o valor de NoEncryption enumeração é usado para construir uma SslStream instância.

Windows Server 2003 e Windows XP não dão suporte ao Null valor. Portanto, mesmo que o Null valor seja usado para construir a SslStream instância, a EncryptionPolicy propriedade será None. O Null valor é retornado apenas no Windows Vista e posterior.

Aplica-se a