Freigeben über


CipherAlgorithmType Enumeration

Definition

Definiert die möglichen Verschlüsselungsverfahrensalgorithmen für die SslStream-Klasse.

public enum class CipherAlgorithmType
public enum CipherAlgorithmType
type CipherAlgorithmType = 
Public Enum CipherAlgorithmType
Vererbung
CipherAlgorithmType

Felder

Aes 26129

Der AES-Algorithmus (Advanced Encryption Standard).

Aes128 26126

Der AES-Algorithmus (Advanced Encryption Standard) mit einem 128-Bit-Schlüssel.

Aes192 26127

Der AES-Algorithmus (Advanced Encryption Standard) mit einem 192-Bit-Schlüssel.

Aes256 26128

Der AES-Algorithmus (Advanced Encryption Standard) mit einem 256-Bit-Schlüssel.

Des 26113

Der DES-Algorithmus (Data Encryption Standard).

None 0

Es wird kein Verschlüsselungsalgorithmus verwendet.

Null 24576

Keine Verschlüsselung wird mit einem NULL-Verschlüsselungsverfahrensalgorithmus verwendet.

Rc2 26114

RC2-Algorithmus (Rivest's Code 2).

Rc4 26625

RC4-Algorithmus (Rivest's Code 4).

TripleDes 26115

Der 3DES-Algorithmus (Triple Data Encryption Standard).

Beispiele

Im folgenden Beispiel werden die Eigenschaften eines SslStreamangezeigt.

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;
    }
}

Hinweise

Diese Enumeration gibt gültige Werte für die SslStream.CipherAlgorithm Eigenschaft an.

Gilt für:

Weitere Informationen