CipherAlgorithmType Wyliczenie
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Definiuje możliwe algorytmy szyfrowania dla SslStream klasy .
public enum class CipherAlgorithmType
public enum CipherAlgorithmType
type CipherAlgorithmType =
Public Enum CipherAlgorithmType
- Dziedziczenie
Nazwa | Wartość | Opis |
---|---|---|
Aes | 26129 | Algorytm AES (Advanced Encryption Standard). |
Aes128 | 26126 | Algorytm Advanced Encryption Standard (AES) z 128-bitowym kluczem. |
Aes192 | 26127 | Algorytm Advanced Encryption Standard (AES) z 192-bitowym kluczem. |
Aes256 | 26128 | Algorytm Advanced Encryption Standard (AES) z 256-bitowym kluczem. |
Des | 26113 | Algorytm szyfrowania danych w warstwie Standardowa (DES). |
None | 0 | Nie jest używany żaden algorytm szyfrowania. |
Null | 24576 | Żadne szyfrowanie nie jest używane z algorytmem szyfrowania null. |
Rc2 | 26114 | Algorytm kodu 2 (RC2) języka Rivest. |
Rc4 | 26625 | Algorytm Code 4 (RC4) firmy Rivest. |
TripleDes | 26115 | Algorytm Triple Data Encryption Standard (3DES). |
W poniższym przykładzie są wyświetlane właściwości obiektu 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;
}
}
Wyliczenie określa prawidłowe wartości właściwości SslStream.CipherAlgorithm .
Produkt | Wersje |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: