SslStream.IsEncrypted Właściwość

Definicja

Pobiera wartość wskazującą Boolean , czy używa to SslStream szyfrowania danych.

public:
 virtual property bool IsEncrypted { bool get(); };
public override bool IsEncrypted { get; }
member this.IsEncrypted : bool
Public Overrides ReadOnly Property IsEncrypted As Boolean

Wartość właściwości

true jeśli dane są szyfrowane przed przesłaniem za pośrednictwem sieci i odszyfrowywane po dotarciu do zdalnego punktu końcowego; w przeciwnym razie false.

Przykłady

Poniższy przykład kodu przedstawia wartość tej właściwości.

static void DisplaySecurityServices( SslStream^ stream )
{
   Console::WriteLine( L"Is authenticated: {0} as server? {1}", stream->IsAuthenticated, stream->IsServer );
   Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
   Console::WriteLine( L"Is Encrypted: {0}", stream->IsEncrypted );
   Console::WriteLine( L"Is mutually authenticated: {0}", stream->IsMutuallyAuthenticated );
}
static void DisplaySecurityServices(SslStream stream)
{
   Console.WriteLine("Is authenticated: {0} as server? {1}", stream.IsAuthenticated, stream.IsServer);
   Console.WriteLine("IsSigned: {0}", stream.IsSigned);
   Console.WriteLine("Is Encrypted: {0}", stream.IsEncrypted);
   Console.WriteLine("Is mutually authenticated: {0}", stream.IsMutuallyAuthenticated);
}
Private Shared Sub DisplaySecurityServices(stream As SslStream)
    Console.WriteLine("Is authenticated: {0} as server? {1}", stream.IsAuthenticated, stream.IsServer)
    Console.WriteLine("IsSigned: {0}", stream.IsSigned)
    Console.WriteLine("Is Encrypted: {0}", stream.IsEncrypted)
    Console.WriteLine("Is mutually authenticated: {0}", stream.IsMutuallyAuthenticated)
End Sub

Uwagi

Szyfrowanie pomaga chronić prywatność danych, a mianowicie pomaga zapewnić, że podczas przesyłania danych nie można go odszyfrować przez inne firmy.

Dotyczy