Hi @Anuj Jain ,
Thanks for reaching out.
Your understanding is correct here and all the queries you have are valid from developer's point of view.
All the secrets, keys, certificates, SSH pairs generated are always in key pair value either to validate or sign by other party to work together.
But if those private keys are exposed to attackers, then all our services and resources are compromised.
To avoid the exposure to private keys, we need to store them at safe place which reduce the chance of accidental cause.
Azure Key Vault is used to store private keys. When you create RSA or EC is Azure Key vault, it creates a private key, but we can't retrieve or download private keys for RSA. It is part of security guarantee that key is generated in vault or HSM tied to security world, and it never leaves the security boundary.
Microsoft and your application don't have access to the stored keys directly once a key is created or added to a key vault. Applications must use your keys by calling cryptography methods on the Key Vault service.
However, you can download the public key from the
- Azure portal (in .pem format)
2.Using CLI
az keyvault key show --vault-name 'keyvaultname' --name 'keyName' --version 'keyVersion' > C:\Users\Desktop\output.txt
It will export the key as text file.
VM creation or most of the time certificates as well provide private/public key pair, but those private keys are always in compromised state and always require owners to keep them in safe place. To avoid this, Azure adds one more layer of security, Azure Key Vault which provide safe vault for those large number of secrets, passwords, keys which is difficult to keep safe.
Hope this will help.
Thanks,
Shweta
---------------------------------------------------
Please remember to "Accept Answer" if answer helped you.