Key. Get Property(String, CngPropertyOptions) Method
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.
Gets a property, given a name and a set of property options.
public: System::Security::Cryptography::CngProperty GetProperty(System::String ^ name, System::Security::Cryptography::CngPropertyOptions options);
public System.Security.Cryptography.CngProperty GetProperty (string name, System.Security.Cryptography.CngPropertyOptions options);
[System.Security.SecurityCritical] public System.Security.Cryptography.CngProperty GetProperty (string name, System.Security.Cryptography.CngPropertyOptions options);
member this.GetProperty : string * System.Security.Cryptography.CngPropertyOptions -> System.Security.Cryptography.CngProperty
[<System.Security.SecurityCritical>] member this.GetProperty : string * System.Security.Cryptography.CngPropertyOptions -> System.Security.Cryptography.CngProperty
Public Function GetProperty (name As String, options As CngPropertyOptions) As CngProperty
The name of the desired property.
A bitwise combination of the enumeration values that specify options for the named property.
An object that contains the raw value of the specified property.
All other errors.
The purpose of this method is to return the value of an arbitrary property of the key. The typical way to retrieve properties is by using the property accessors provided by the CngKey class. CngKey provides wrappers for several, but not all, properties. The GetProperty method is primarily used to access the value of a property that is not wrapped.
This method is useful in the following cases:
A new version of the operating system supports a new Cryptography Next Generation (CNG) key property that does not have a wrapper.
You add a custom property to the key.
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.