SafeNCryptSecretHandle 類別

定義

提供代表密碼協議值 (NCRYPT_SECRET_HANDLE) 的安全控制代碼。Provides a safe handle that represents a secret agreement value (NCRYPT_SECRET_HANDLE).

public ref class SafeNCryptSecretHandle sealed : Microsoft::Win32::SafeHandles::SafeNCryptHandle
public sealed class SafeNCryptSecretHandle : Microsoft.Win32.SafeHandles.SafeNCryptHandle
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public sealed class SafeNCryptSecretHandle : Microsoft.Win32.SafeHandles.SafeNCryptHandle
type SafeNCryptSecretHandle = class
    inherit SafeNCryptHandle
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type SafeNCryptSecretHandle = class
    inherit SafeNCryptHandle
Public NotInheritable Class SafeNCryptSecretHandle
Inherits SafeNCryptHandle
繼承
繼承
SafeNCryptSecretHandle
屬性

備註

使用需要 NCRYPT_SECRET_HANDLE 的原生程式碼時,應該使用這個類別。This class should be used when working with native code that expects an NCRYPT_SECRET_HANDLE.

重要

此型別代表 IDisposable 介面。This type implements the IDisposable interface. 當您完成使用型別時,您應該直接或間接處置它。When you have finished using the type, you should dispose of it either directly or indirectly. 若要直接處置型別,請呼叫其 try/catch 區塊中的 Dispose 方法。To dispose of the type directly, call its Dispose method in a try/catch block. 若要間接處置它,請使用語言建構函式,例如 using (在 C# 中) 或 Using (在 Visual Basic 中)。To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). 如需詳細資訊,請參閱 IDisposable 介面文章中的<使用實作 IDisposable 的物件>一節。For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.

建構函式

SafeNCryptSecretHandle()

初始化 SafeNCryptSecretHandle 類別的新執行個體。Initializes a new instance of the SafeNCryptSecretHandle class.

欄位

handle

指定要包裝的控制代碼。Specifies the handle to be wrapped.

(繼承來源 SafeHandle)

屬性

IsClosed

取得值,指出控制代碼是否已關閉。Gets a value indicating whether the handle is closed.

(繼承來源 SafeHandle)
IsInvalid

取得值,表示控制代碼是否無效。Gets a value that indicates whether the handle is invalid.

(繼承來源 SafeNCryptHandle)

方法

Close()

標記要釋出和釋放資源的控制代碼。Marks the handle for releasing and freeing resources.

(繼承來源 SafeHandle)
DangerousAddRef(Boolean)

手動遞增 SafeHandle 執行個體上的參考計數器。Manually increments the reference counter on SafeHandle instances.

(繼承來源 SafeHandle)
DangerousGetHandle()

傳回 handle 欄位的值。Returns the value of the handle field.

(繼承來源 SafeHandle)
DangerousRelease()

手動遞減 SafeHandle 執行個體上的參考計數器。Manually decrements the reference counter on a SafeHandle instance.

(繼承來源 SafeHandle)
Dispose()

釋放 SafeHandle 類別使用的所有資源。Releases all resources used by the SafeHandle class.

(繼承來源 SafeHandle)
Dispose(Boolean)

釋放 SafeHandle 類別所使用的 Unmanaged 資源,指定是否要執行一般處置作業。Releases the unmanaged resources used by the SafeHandle class specifying whether to perform a normal dispose operation.

(繼承來源 SafeHandle)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ReleaseHandle()

釋放 Cryptography Next Generation (CNG) 物件使用的控制代碼。Releases a handle used by a Cryptography Next Generation (CNG) object.

(繼承來源 SafeNCryptHandle)
ReleaseNativeHandle()

釋放 Cryptography Next Generation (CNG) 物件使用的原生控制代碼。Releases a native handle used by a Cryptography Next Generation (CNG) object.

(繼承來源 SafeNCryptHandle)
SetHandle(IntPtr)

將控制代碼設定為指定的既有控制代碼。Sets the handle to the specified pre-existing handle.

(繼承來源 SafeHandle)
SetHandleAsInvalid()

將控制代碼標記為不再使用。Marks a handle as no longer used.

(繼承來源 SafeHandle)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於