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 或零,這個方法仍會正確運作。

適用於