This project has moved and is read-only. For the latest updates, please go here.

Creating AES Keys with CngKey

Mar 6, 2013 at 10:48 PM

I have a project that will need to use a HSM. The HSM supports CNG.

I am trying to create an AES Key like below:

CngKey aesCreate = CngKey.Create(new CngAlgorithm("AES"), "MyKeyAES");

But I get the following CryptographicException "The requested operation is not supported."

I need to be able to store AES keys in the HSM. Am I going about this the right way or have I got it completely wrong.