Azure key - using rsa (private and public key)
The idea is pretty simple, create a rsa key in azure. Use public key to encrypt. Then use private key to decrypt. Private key never leave the vault.
Here is the code for doing that.
If you're getting bad request? Please check to make sure you have added MSI to the keyvault access policy.
I had that many many times the following error message,
Unhandled Exception: Microsoft.Azure.KeyVault.Models.KeyVaultErrorException: Operation returned an invalid status code 'BadRequest'
var encryptedText = rsa.Encrypt(byteData, fOAEP: true); // use to be false :(
Comments