【问题标题】:Not able to upload Pfx certifcate to Azure key Vault无法将 Pfx 证书上传到 Azure 密钥保管库
【发布时间】:2019-01-23 14:31:04
【问题描述】:

团队,

每当我尝试通过此处提到的步骤将 pfx 证书上传到 azure key vault 时

$securepfxpwd = ConvertTo-SecureString –String 'password' –AsPlainText –Force # Password for the private key PFX certificate 
$certificateName = 'My-Cert' 
$vaultName = 'MyVault' 
$cer = Import-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -FilePath 'C:\My-Cert.pfx' -Password $securepfxpwd 

我收到这个错误

Import-AzureKeyVaultCertificate:不支持的密钥大小 (1024)。 支持的大小为 [2048, 3072, 4096] At line:1 char:8 + $cer = Import-AzureKeyVaultCertificate -VaultName $vaultName -Name $c ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Import-AzureKeyVaultCertificate], KeyVaultErrorException + FullyQualifiedErrorId : Microsoft.Azure.Commands.KeyVault.ImportAzureKeyVaultCertificate

我如何上传一个小于 2048 的 pfx,或者 keyvault 只接受方括号中提到的大小。

【问题讨论】:

    标签: azure azure-web-app-service azure-powershell azure-keyvault


    【解决方案1】:

    您可以将证书存储为机密而不是证书。

    例如https://gist.github.com/bmoore-msft/425b79b7b7e226264554ec534b956a48

    【讨论】:

    • 谢谢亚历克斯。似乎是一个答案。但是,我的 cdrive 上有一个现有的 pfx 证书。有什么办法可以更改代码吗?它要求自签名证书。
    猜你喜欢
    • 2020-01-18
    • 2020-10-19
    • 2019-07-15
    • 2022-01-18
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 2012-06-06
    • 1970-01-01
    相关资源
    最近更新 更多