CngKeyCreationParameters CngKeyCreationParameters CngKeyCreationParameters CngKeyCreationParameters Class


包含密钥创建的高级属性。Contains advanced properties for key creation.

public ref class CngKeyCreationParameters sealed
public sealed class CngKeyCreationParameters
type CngKeyCreationParameters = class
Public NotInheritable Class CngKeyCreationParameters


CngKey对象包含属性。CngKey objects contain properties. 创建项时, 必须向其中添加某些属性。Some properties must be added to a key when it is created. 创建密钥后, 可以添加其他属性。Other properties can be added after the key is created.

CngKeyCreationParameters类使你能够在创建密钥时向其添加属性。The CngKeyCreationParameters class enables you to add properties to a key as it is being created. 为此, 可将包含标准CngKeyCreationParameters密钥属性的对象 (例如密钥存储提供程序 (KSP)、导出策略、密钥用法、用户界面 (UI) 策略和父窗口句柄) 传递给方法。CreateYou can do this by passing a CngKeyCreationParameters object that contains standard key properties, such as key storage provider (KSP), export policy, key usage, user interface (UI) policy, and parent window handle, to the Create method. 正在CngKey创建的对象将在完成前用这些值进行初始化。The CngKey object that is being created will be initialized with these values before it is finalized.

还可以使用Parameters属性向密钥添加非标准属性。You can also add non-standard properties to a key by using the Parameters property.

如果需要在创建密钥后添加属性, 请使用SetProperty方法。If you need to add properties after a key is created, use the SetProperty method.


CngKeyCreationParameters() CngKeyCreationParameters() CngKeyCreationParameters() CngKeyCreationParameters()

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


ExportPolicy ExportPolicy ExportPolicy ExportPolicy

获取或设置密钥导出策略。Gets or sets the key export policy.

KeyCreationOptions KeyCreationOptions KeyCreationOptions KeyCreationOptions

获取或设置密钥创建选项。Gets or sets the key creation options.

KeyUsage KeyUsage KeyUsage KeyUsage

获取或设置应用于当前密钥的加密操作。Gets or sets the cryptographic operations that apply to the current key.

Parameters Parameters Parameters Parameters

可使用密钥创建完成之前设置的其他属性创建 CngKey 对象。Enables a CngKey object to be created with additional properties that are set before the key is finalized.

ParentWindowHandle ParentWindowHandle ParentWindowHandle ParentWindowHandle

获取或设置窗口句柄,该句柄应用作由下一代加密技术 (CNG) 类创建的对话框的父窗口的句柄。Gets or sets the window handle that should be used as the parent window for dialog boxes that are created by Cryptography Next Generation (CNG) classes.

Provider Provider Provider Provider

获取或设置在其中创建密钥的密钥存储提供程序 (KSP)。Gets or sets the key storage provider (KSP) to create a key in.

UIPolicy UIPolicy UIPolicy UIPolicy

获取或设置有关创建或访问密钥时显示的用户界面的信息。Gets or sets information about the user interface to display when a key is created or accessed.


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)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)