NegotiateStream.IsMutuallyAuthenticated 属性

定义

获取一个 Boolean 值,该值指示服务器和客户端是否均已进行身份验证。

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

属性值

如果服务器已进行身份验证,则为 true;否则为 false

示例

下面的代码示例演示如何显示此属性的值。

static void DisplayAuthenticationProperties( NegotiateStream^ stream )
{
   Console::WriteLine( L"IsAuthenticated: {0}", stream->IsAuthenticated );
   Console::WriteLine( L"IsMutuallyAuthenticated: {0}", stream->IsMutuallyAuthenticated );
   Console::WriteLine( L"IsEncrypted: {0}", stream->IsEncrypted );
   Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
   Console::WriteLine( L"ImpersonationLevel: {0}", stream->ImpersonationLevel );
   Console::WriteLine( L"IsServer: {0}", stream->IsServer );
}


 static void DisplayAuthenticationProperties(NegotiateStream stream)
{
     Console.WriteLine("IsAuthenticated: {0}", stream.IsAuthenticated);
    Console.WriteLine("IsMutuallyAuthenticated: {0}", stream.IsMutuallyAuthenticated);
    Console.WriteLine("IsEncrypted: {0}", stream.IsEncrypted);
    Console.WriteLine("IsSigned: {0}", stream.IsSigned);
    Console.WriteLine("ImpersonationLevel: {0}", stream.ImpersonationLevel);
    Console.WriteLine("IsServer: {0}", stream.IsServer);
}

注解

当客户端希望服务器提供用于身份验证的凭据时,客户端会指定相互身份验证。 默认情况下,客户端请求相互身份验证。

协商协议根据客户端和服务器支持的安全协议选择 NTLM 或 Kerberos。 NTLM 不支持相互身份验证。

适用于