This project has moved. For the latest updates, please go here.
1
Vote

Not compatible with "Microsoft Platform Crypto Provider" for TPM device

description

Hi,

When I use your Cng implementation for creating a selg signed certificate for a TPM device...I encountered the following exception in your code X509Native.cs :
            // Setup a CRYPT_KEY_PROV_INFO for the key
            CRYPT_KEY_PROV_INFO keyProvInfo = new CRYPT_KEY_PROV_INFO();
            keyProvInfo.pwszProvName = key.Provider.Provider;
            keyProvInfo.pwszContainerName = key.UniqueName;
            keyProvInfo.dwProvType = 0;     // NCRYPT
            keyProvInfo.dwFlags = 0;
            keyProvInfo.cProvParam = 0;
            keyProvInfo.rgProvParam = IntPtr.Zero;
            keyProvInfo.dwKeySpec = 0;
The key.UniqueName is not defined and threw an exception of type System.Security.Cryptography.CryptographicException' string {System.Security.Cryptography.CryptographicException}

That's the same things for key.IsEphemeral and key.KeyName

comments