0

Having difficulty making CryptAcquireContext work for a .NET app. I've created the key, but it's throwing error NTE_BAD_KEYSET.

The documentation suggests that the trouble is with permissions, but I'm not quite sure who to give permission to. So far have tried:

SYSTEM NETWORK NETWORK SERVICE ASPNET Administrators Cryptographic Operators

No dice.

Any ideas?

This is a machine key.

UPDATE: Gave access to EVERYONE and that seems to have worked. However, it seems like a bad security practice. The question stands: who should actually be getting access?

christok
  • 1,087
  • 2
  • 12
  • 29
  • Ain't that the truth. – christok Feb 07 '14 at 20:17
  • 1
    You'll most likely want to assign access to the account that the app pool runs under. Or impersonate in your code some other user with access. http://msdn.microsoft.com/en-us/library/2w117ede.ASPX – Mike Cheel Feb 07 '14 at 20:29

0 Answers0