SafeNCryptKeyHandle SafeNCryptKeyHandle SafeNCryptKeyHandle SafeNCryptKeyHandle Class

定义

提供了表示密钥 (NCRYPT_KEY_HANDLE) 的安全句柄。Provides a safe handle that represents a key (NCRYPT_KEY_HANDLE).

public ref class SafeNCryptKeyHandle sealed : Microsoft::Win32::SafeHandles::SafeNCryptHandle
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public sealed class SafeNCryptKeyHandle : Microsoft.Win32.SafeHandles.SafeNCryptHandle
type SafeNCryptKeyHandle = class
    inherit SafeNCryptHandle
Public NotInheritable Class SafeNCryptKeyHandle
Inherits SafeNCryptHandle
继承
属性

注解

使用需要 NCRYPT_KEY_HANDLE 的本机代码时, 应使用此类。This class should be used when working with native code that expects an NCRYPT_KEY_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.

构造函数

SafeNCryptKeyHandle() SafeNCryptKeyHandle() SafeNCryptKeyHandle() SafeNCryptKeyHandle()

初始化 SafeNCryptKeyHandle 类的新实例。Initializes a new instance of the SafeNCryptKeyHandle class.

SafeNCryptKeyHandle(IntPtr, SafeHandle) SafeNCryptKeyHandle(IntPtr, SafeHandle) SafeNCryptKeyHandle(IntPtr, SafeHandle) SafeNCryptKeyHandle(IntPtr, SafeHandle)

实例化 SafeNCryptKeyHandle 类的新实例。Instantiates a new instance of the SafeNCryptKeyHandle class.

属性

IsClosed IsClosed IsClosed IsClosed

获取一个值,该值指示句柄是否已关闭。Gets a value indicating whether the handle is closed.

(Inherited from SafeHandle)
IsInvalid IsInvalid IsInvalid IsInvalid Inherited from SafeNCryptHandle

方法

Close() Close() Close() Close()

标记句柄,以便释放资源。Marks the handle for releasing and freeing resources.

(Inherited from SafeHandle)
DangerousAddRef(Boolean) DangerousAddRef(Boolean) DangerousAddRef(Boolean) DangerousAddRef(Boolean)

手动递增 SafeHandle 实例中的引用计数器。Manually increments the reference counter on SafeHandle instances.

(Inherited from SafeHandle)
DangerousGetHandle() DangerousGetHandle() DangerousGetHandle() DangerousGetHandle()

返回 handle 字段的值。Returns the value of the handle field.

(Inherited from SafeHandle)
DangerousRelease() DangerousRelease() DangerousRelease() DangerousRelease()

手动递减 SafeHandle 实例中的引用计数器。Manually decrements the reference counter on a SafeHandle instance.

(Inherited from SafeHandle)
Dispose() Dispose() Dispose() Dispose()

释放 SafeHandle 类使用的所有资源。Releases all resources used by the SafeHandle class.

(Inherited from SafeHandle)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放 SafeHandle 类所使用的非托管资源,并指定是否执行常规释放 (Dispose) 操作。Releases the unmanaged resources used by the SafeHandle class specifying whether to perform a normal dispose operation.

(Inherited from SafeHandle)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ReleaseHandle() ReleaseHandle() ReleaseHandle() ReleaseHandle()

释放由下一代加密技术 (CNG) 对象使用的句柄。Releases a handle used by a Cryptography Next Generation (CNG) object.

(Inherited from SafeNCryptHandle)
ReleaseNativeHandle() ReleaseNativeHandle() ReleaseNativeHandle() ReleaseNativeHandle()

释放由下一代加密技术 (CNG) 对象使用的本机句柄。Releases a native handle used by a Cryptography Next Generation (CNG) object.

(Inherited from SafeNCryptHandle)
SetHandle(IntPtr) SetHandle(IntPtr) SetHandle(IntPtr) SetHandle(IntPtr)

将句柄设置为预先存在的指定句柄。Sets the handle to the specified pre-existing handle.

(Inherited from SafeHandle)
SetHandleAsInvalid() SetHandleAsInvalid() SetHandleAsInvalid() SetHandleAsInvalid()

将句柄标记为不再使用。Marks a handle as no longer used.

(Inherited from SafeHandle)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

字段

handle handle handle handle

指定要包装的句柄。Specifies the handle to be wrapped.

(Inherited from SafeHandle)

安全性

SecurityPermission
用于调用非托管代码的权限。for permission to call unmanaged code. 需求值: LinkDemandDemand value: LinkDemand. 关联的枚举:UnmanagedCodeAssociated enumeration: UnmanagedCode

适用于