CipherAlgorithmType Enum

Definitie

Let op

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

Definieert de mogelijke coderingsalgoritmen voor de SslStream klasse.

public enum class CipherAlgorithmType
public enum CipherAlgorithmType
[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 enum CipherAlgorithmType
type CipherAlgorithmType = 
[<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}")>]
type CipherAlgorithmType = 
Public Enum CipherAlgorithmType
Overname
CipherAlgorithmType
Kenmerken

Velden

Name Waarde Description
None 0

Er wordt geen versleutelingsalgoritmen gebruikt.

Null 24576

Er wordt geen versleuteling gebruikt met een null-coderingsalgoritmen.

Des 26113

Het DES-algoritme (Data Encryption Standard).

Rc2 26114

Het algoritme Code 2 (RC2) van Rivest.

TripleDes 26115

Het algoritme Triple Data Encryption Standard (3DES).

Aes128 26126

Het AES-algoritme (Advanced Encryption Standard) met een 128-bits sleutel.

Aes192 26127

Het AES-algoritme (Advanced Encryption Standard) met een 192-bits sleutel.

Aes256 26128

Het AES-algoritme (Advanced Encryption Standard) met een 256-bits sleutel.

Aes 26129

Het AES-algoritme (Advanced Encryption Standard).

Rc4 26625

Het algoritme Code 4 (RC4) van De klinknagelst.

Voorbeelden

In het volgende voorbeeld worden de eigenschappen van een SslStream.

static void AuthenticateCallback( IAsyncResult^ ar )
{
   SslStream^ stream = dynamic_cast<SslStream^>(ar->AsyncState);
   try
   {
      stream->EndAuthenticateAsClient( ar );
      Console::WriteLine( L"Authentication succeeded." );
      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 );
      
      // Encode a test message into a byte array.
      // Signal the end of the message using the "<EOF>".
      array<Byte>^message = Encoding::UTF8->GetBytes( L"Hello from the client.<EOF>" );
      
      // Asynchronously send a message to the server.
      stream->BeginWrite( message, 0, message->Length, gcnew AsyncCallback( WriteCallback ), stream );
   }
   catch ( Exception^ authenticationException ) 
   {
      e = authenticationException;
      complete = true;
      return;
   }

}
static void AuthenticateCallback(IAsyncResult ar)
{
    SslStream stream = (SslStream) ar.AsyncState;
    try
    {
        stream.EndAuthenticateAsClient(ar);
        Console.WriteLine("Authentication succeeded.");
        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);
        // Encode a test message into a byte array.
        // Signal the end of the message using the "<EOF>".
        byte[] message = Encoding.UTF8.GetBytes("Hello from the client.<EOF>");
        // Asynchronously send a message to the server.
        stream.BeginWrite(message, 0, message.Length,
            new AsyncCallback(WriteCallback),
            stream);
    }
    catch (Exception authenticationException)
    {
        e = authenticationException;
        complete = true;
        return;
    }
}

Opmerkingen

Met deze opsomming worden geldige waarden voor de SslStream.CipherAlgorithm eigenschap opgegeven.

Van toepassing op

Zie ook