語言

NegotiateStream.IsEncrypted 屬性

定義

會得到 Boolean 一個值,表示是否 NegotiateStream 使用資料加密。

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

屬性值

true如果資料在傳輸前已加密,並在抵達遠端端點時解密;否則,。 false

範例

以下程式碼範例展示了此屬性的值。

 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);
}

備註

加密有助於保護資料的隱私;也就是說,它有助於確保資料在傳輸過程中無法被第三方解讀。

適用於

另請參閱