Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AesCng::Key Property

 

Gets or sets the key for the AesCng algorithm.

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

public:
property array<unsigned char>^ Key {
	virtual array<unsigned char>^ get() override;
	virtual void set(array<unsigned char>^ value) override;
}

Property Value

Type: array<System::Byte>^

The key for the AesCng algorithm.

If you've created the AesCng object using an existing persisted key, when you read the value of the Key property, an attempt to export the key will be made. In this case, if the key is not exportable, a CryptographicException will be thrown.

In addition to that, if you set the value of the Key property, the persisted key will no longer be used and a temporary key will be used instead. If you need to use the persisted key again, a new instance of AesCng class needs to be created.

.NET Framework
Available since 4.6.2
Return to top
Show:
© 2017 Microsoft