【发布时间】:2016-02-17 03:04:54
【问题描述】:
我有一堆字符串和 pfx 证书,我想将它们存储在 Azure Key Vault 中,只有允许的用户/应用程序才能获取它们。将字符串存储为 Secret 并不难,但我如何序列化证书以便我可以检索它并反序列化为 C# 中的 X509Certificate2 对象?
我尝试将其存储为密钥。这是 Azure PowerShell 代码
$securepfxpwd = ConvertTo-SecureString -String 'superSecurePassword' -AsPlainText -Force
$key = Add-AzureKeyVaultKey -VaultName 'UltraVault' -Name 'MyCertificate' -KeyFilePath 'D:\Certificates\BlaBla.pfx' -KeyFilePassword $securepfxpwd
但是当我尝试用 GetKeyAsync 方法获取它时,我无法使用它。
【问题讨论】:
标签: c# azure certificate x509certificate2 azure-keyvault