Error while trying to set key exportable (NCRYPT_EXPORT_POLICY_PROPERTY) - 0x8009002D - Internal Error

0

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.

c#
cryptography
smartcard
cng
asked on Stack Overflow May 25, 2020 by Sagir

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0