How to use Azure Key Vault in and ASP.NET Project
- Creating a self-signed certificate with powershell (this one was created with a wild card *cloudapp.net) , with public and private key RSA 2048.
- Creating the web app on Azure
- Get the APP ID from the portal ( I did it from the old one but you can do it form the new one I just did know how at that time )
- Ensuite j’ai créé un projet ASP.NET MVC sur Visual Studio pour développer les API, la première chose à effectuer c’est d’ajouter les Keys sur Web.Config récupéré du KeyVault sur le portail.
- Give permissions to key
-
adding C# classes Aes256Encryption, Rsa2048Encryption for encryption and decryption.
-
You will find 4 methods to:
Symetric Encryption :
Symetric Decryption
Asymetric Encyprtion:
Asymetric Decryption: