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 或零,此方法也能正常运行。

适用于