CipherAlgorithmType 열거형

정의

SslStream 클래스에 대해 적절한 암호화 알고리즘을 정의합니다.

public enum class CipherAlgorithmType
public enum CipherAlgorithmType
type CipherAlgorithmType = 
Public Enum CipherAlgorithmType
상속
CipherAlgorithmType

필드

Aes 26129

AES(고급 암호화 표준) 알고리즘입니다.

Aes128 26126

128비트 키의 AES(고급 암호화 표준) 알고리즘입니다.

Aes192 26127

192비트 키의 AES(Advanced Encryption Standard) 알고리즘입니다.

Aes256 26128

256비트 키의 AES(Advanced Encryption Standard) 알고리즘입니다.

Des 26113

DES(데이터 암호화 표준) 알고리즘입니다.

None 0

사용되는 암호화 알고리즘이 없습니다.

Null 24576

Null 암호화 알고리즘에는 암호화가 사용되지 않습니다.

Rc2 26114

RC2(Rivest's Code 2) 알고리즘입니다.

Rc4 26625

RC4(Rivest's Code 4) 알고리즘입니다.

TripleDes 26115

3DES(3중 데이터 암호화 표준) 알고리즘입니다.

예제

다음 예제에서는 속성을 표시는 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;
    }
}

설명

이 열거형에 대 한 유효한 값을 지정 합니다 SslStream.CipherAlgorithm 속성입니다.

적용 대상

추가 정보