SslStream.IsAuthenticated Właściwość

Definicja

Pobiera wartość wskazującą Boolean , czy uwierzytelnianie zakończyło się pomyślnie.

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

Wartość właściwości

Boolean

true w przypadku pomyślnego uwierzytelnienia; 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 );
}
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);
}
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)
End Sub

Uwagi

Klienci uwierzytelniają się, wywołując AuthenticateAsClient metody lub BeginAuthenticateAsClient . Serwery uwierzytelniają się przez wywołanie AuthenticateAsServer metod lub BeginAuthenticateAsServer .

Dotyczy