CngKey.HasProperty(String, CngPropertyOptions) 方法

定义

检查密钥上是否存在指定的属性。

public:
 bool HasProperty(System::String ^ name, System::Security::Cryptography::CngPropertyOptions options);
public bool HasProperty (string name, System.Security.Cryptography.CngPropertyOptions options);
[System.Security.SecurityCritical]
public bool HasProperty (string name, System.Security.Cryptography.CngPropertyOptions options);
member this.HasProperty : string * System.Security.Cryptography.CngPropertyOptions -> bool
[<System.Security.SecurityCritical>]
member this.HasProperty : string * System.Security.Cryptography.CngPropertyOptions -> bool
Public Function HasProperty (name As String, options As CngPropertyOptions) As Boolean

参数

name
String

要检查的属性名称。

options
CngPropertyOptions

指定已命名属性选项的枚举值的按位组合。

返回

如果找到指定的属性,则为 true;否则为 false

属性

例外

namenull

注解

参数 options 专门用于指示以下内容:

  • 属性是内置属性还是自定义属性。

  • 属性是否应与 键一起保留。

这些选项必须与设置属性时使用的值匹配,否则将找不到该属性。

即使属性设置为 false 或零,此方法也能正常运行。

适用于