I am trying to set key exportable after generation, I am using NCrypt: First I am calling NCryptOpenStorageProvider to initialize provider handle, after that I am calling NcryptCreatePersistedKey to create key pair. this functions works well without errors.
After that I call NCryptSetProperty with NCRYPT_EXPORT_POLICY_PROPERTY:
uint ret = NCryptSetProperty(Key Handle, NCRYPT_EXPORT_POLICY_PROPERTY, Bit Converter.GetBytes(NCRYPT_ALLOW_EXPORT_FLAG) , sizeof(uint) ,0);
If(ret != ERROR_SUCCESS)
{
Console.WriteLine(ret.toString());
}
I got error 0x8009002D - Internal error.
User contributions licensed under CC BY-SA 3.0