Compartilhar via


SslStream.IsAuthenticated Propriedade

Definição

Obtém um valor Boolean que indica se a autenticação foi bem-sucedida.

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

Valor da propriedade

true se ocorreu uma autenticação bem-sucedida; caso contrário, false.

Exemplos

O exemplo de código a seguir demonstra a exibição do valor dessa propriedade.

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

Comentários

Os clientes se autenticam chamando os AuthenticateAsClient métodos ou BeginAuthenticateAsClient . Os servidores se autenticam chamando os AuthenticateAsServer métodos ou BeginAuthenticateAsServer .

Aplica-se a