问题
Any idea if store and retrieval (export the symmetric key out of keyvault) of symmetric keys is supported in Azure Kev vault or possible? I referenced Azure Keyvault documents here and it mentions the Symmetric keys are not supported and may be supported in future (not sure though if the documentation I read is current).
If it’s not supported, is there a way to simulate this using other interfaces like Secrets? Could you share a sample code to do this using Azure Keyvault REST API?
回答1:
You are right about storing the symmetric keys as secrets.
REST API
Here is a detailed article around the code involved to do this using REST API http://thuansoldier.net/7329/
.NET SDK
Here is the nuget package https://www.nuget.org/packages/Microsoft.Azure.KeyVault/
You can use the KeyVaultClient class and GetSecretAsync method.
Here is an example on Microsoft Docs - https://docs.microsoft.com/en-us/azure/key-vault/key-vault-use-from-web-application
Similar SDKs are available for Node.js, Java and Python
来源:https://stackoverflow.com/questions/52048614/storing-and-retrieving-symmetric-keys-in-azure-keyvault