Search code examples
windowsstoragedesktop-applicationapi-key

Can an API key be securely stored/retrieved by a windows desktop app?


Is there a way to securely store and retrieve an API key in windows?

For instance, is there a windows service/api that can be used by a (c#) desktop app to store and retrieve a key?


Solution

  • Sorry to answer my own question, but it appears Windows Credential Manager and the underlying Data Protection API is designed for this very purpose. It's the same vault used by Windows to store it's various passwords.

    And it has a nice c# API.. https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-use-data-protection

    Answered more fully here.. PasswordVault security when used from Desktop app