Edit

Share via


CngKey.HasProperty(String, CngPropertyOptions) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Checks to see whether the specified property exists on the key.

C#
public bool HasProperty(string name, System.Security.Cryptography.CngPropertyOptions options);
C#
[System.Security.SecurityCritical]
public bool HasProperty(string name, System.Security.Cryptography.CngPropertyOptions options);

Parameters

name
String

The property name to check.

options
CngPropertyOptions

A bitwise combination of the enumeration values that specify options for the named property.

Returns

true if the specified property is found; otherwise, false.

Attributes

Exceptions

name is null.

Remarks

The options parameter is specifically used to indicate the following:

  • Whether the property is built-in, or custom.

  • Whether the property should be persisted with the key.

These options must match the value that the property was set with, or the property will not be found.

This method operates correctly even if the property is set to false or zero.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5