Export (0) Print
Expand All

CngKey.HasProperty Method

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

Namespace:  System.Security.Cryptography
Assembly:  System.Core (in System.Core.dll)

[SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode = true)]
public bool HasProperty(
	string name,
	CngPropertyOptions options
)

Parameters

name
Type: System.String

The property name to check.

options
Type: System.Security.Cryptography.CngPropertyOptions

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

Return Value

Type: System.Boolean
true if the specified property is found; otherwise, false.

ExceptionCondition
ArgumentNullException

name is null.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft