We need to provide a license key to customers for our application. The actual license is XML but we need to encrypt it and then in our program decrypt it. I think it is the following, but am asking to make sure I'm not missing something (the below is updated from encrypting to signing based on the below comments):
- On our server create the XML for the key. The key is in the key container on the server.
- On our server sign the XML using our private key.
- UUEncode the encrypted license so it emails ok.
- Email the license to our customer.
- The customer puts the license in their app.exe.config file.
- The app reads the license from the config file.
- The app UUDecodes the license.
- The app verifies the signing using our public key. The public key is embedded in the program.
- We now have the XML and use the license properties.
Is this the best way to do this? If not, what approach should we take?
If yes, what .NET API should we use for this and are there any links to sample code?
And a giant thank you to all who walked me through this.