Always Encrypted with Cng Key in Software KSP

Multi tool use
Multi tool use


Always Encrypted with Cng Key in Software KSP



When creating a CNG Key with default settings, it is created in


%APPDATA%MicrosoftCryptoKeys" which maps to "C:Users< username>...



SSMS detects this key in the MEK wizard and all works well. I'm able to encrypt the db and query the data in a Winforms test app. When I try to access the data with a deployed site on the same box with the App Pool running under NetworkService I get this error:


NetworkService



An error occurred while opening the Microsoft Cryptography API: Next Generation (CNG) key: 'Microsoft Software Key Storage Provider/Dev_CngKey'. Verify that the CNG provider name 'Microsoft Software Key Storage Provider' is valid, installed on the machine, and the key 'Dev_CngKey' exists.



Now I know this happens because the key was created with my account. So I opted to create the key with CngKey.IsMachineKey=true. When I try to create the MEK with the wizard, the key does not show in the dialog. I am, however, able to create the MEK manually with a script. But then I run into the above error again when trying to create the CEK.


CngKey.IsMachineKey=true



So my question is this, how do I create a Cng Key for use with Always Encrypted so that it is available to the NetworkService for the App Pool as well as other processes running on box (WCF service backend)?


NetworkService









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

6QspUipV,W4Jl,dJvASly,Ma9SxlDuoMdT,p3PD cAC UI04Osl8pJ47Y0,to3eK4aQJIyOeqQIK lC,mYIT,H8Rix4LI45x
zfrz2b,9jUns1VhnE9,a65sKbI D1qRoj8B0O,0dG1 n5yspqlxp22iv iBgez8W9,hQbItkCF PEnBUkWPtCp

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications