NegotiateStream.IsEncrypted 屬性

定義

取得 Boolean 值,指示這個 NegotiateStream 是否使用資料加密。Gets a Boolean value that indicates whether this NegotiateStream uses data encryption.

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

屬性值

Boolean

如果在經由網路傳輸資料前對其進行加密,並在到達遠端端點時將其解密,則為 true,否則為 falsetrue if data is encrypted before being transmitted over the network and decrypted when it reaches the remote endpoint; otherwise, false.

範例

下列程式碼範例示範如何顯示這個屬性的值。The following code example demonstrates displaying the value of this property.

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

備註

加密有助於保護資料的隱私權;亦即,它有助於確保當資料傳輸時,協力廠商無法將它解密。Encryption helps to protect the privacy of the data; namely, it helps to ensure that while data is in transit it cannot be deciphered by third parties.

適用於

另請參閱