我正在寻找一种将 PFX 证书安装到我的 azure 秤集中并将私钥标记为可导出的方法。
目前证书已通过 ARM 模板安装在集群上:
{
"certificateUrl": "https://xxx.vault.azure.net/secrets/xxx/111111",
"certificateStore": "My"
}
但是我进行本地解密所需的私钥是不可导出的。
我正在使用充气城堡来读取创建 AsymmetryCipherKeyPair:
DotNetUtilities.GetRsaKeyPair(privateKey)
(现在抛出异常:Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException:
在System.Security.Cryptography.CngKey.Export(System.Security.Cryptography.Cng,版本=4.3.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a)
我读到here应该在策略中定义 key 是可导出的。但是,一旦 key 上传到 keystore ,就无法更改策略,而且导入证书时也无法对其进行设置。
最佳答案
您使用的是哪种类型的 key ?
请注意,仅 RSA 允许导出,RSA HSM 不支持。
策略应表明当您创建证书时 key 是可导出的。
如果使用 Azure key 保管库生成证书,则可以在创建过程中配置策略。
如果将现有证书导入到 Key Vault,则需要在创建证书时指定 key 可导出的策略。
关于Azure Key Vault 将私钥标记为可导出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58204358/