2017-06-19 56 views
1

我们拥有Azure KeyVault不支持的CA.我们使用KeyVault创建了证书和CSR,并将它们成功提交给CA并导入签名证书。我们现在有一些证书可以在我们使用KeyVault之前进行更新。我们的安全团队已经获得了由CA颁发的新签名证书。但是,当我们导入原始签名的证书和私钥(pfx格式),然后尝试导入新的签名证书时,它会失败,并显示“未找到待定证书”。将这些证书带入KeyVault的正确顺序是什么?如何手动更新AzureKeyValut中的证书

回答

0

因此,关闭上面的评论我能够得到这个工作。

#Password for the pfx file of the original cert 
$password = ConvertTo-SecureString -String '<UPDATETHIS>' -AsPlainText -Force 

#import the orginal cert with private key 
Import-AzureKeyVaultCertificate -VaultName 'VaultName' -Name 'Certname' -FilePath 'PATHTOPFXFILE' -Password $password 

#set the policy to allow key reuse if the CA will create a new signed cert from the existing CSR 
Set-AzureKeyVaultCertificatePolicy -VaultName 'VaultName' -Name 'Certname' -ReuseKeyOnRenewal $true 

#create a cert policy object from the existing cert 
$certpolicy = Get-AzureKeyVaultCertificatePolicy -VaultName 'VaultName' -Name 'Certname' 

#create a pending cert operation, you can pull a new CSR from this if need be 
$certificateOperation = Add-AzureKeyVaultCertificate -VaultName 'VaultName' -Name 'Certname' -CertificatePolicy $certpolicy 

#import the new signed cert into KeyVault for issuing 
Import-AzureKeyVaultCertificate -VaultName 'VaultName' -Name 'Certname' -FilePath 'PATHTONEWSIGNEDCERTINCRT' 
1

Azure密钥保险库证书是一个版本化对象。当你创建一个新的证书时,你正在创建一个新的版本。证书的每个版本在概念上由2部分组成 - 非对称密钥和将非对称密钥与身份相关联的blob。

当您需要使用您自己的CA时,AKV会生成非对称密钥并将CSR返回给用户。用户然后使用CSR获取证书。对于证书的每个版本都是如此。

如果您当前的版本过期,您需要创建一个新版本。您需要按照创建第一个版本时的步骤进行操作。创建新版本时,您可以选择使用相同的非对称密钥。

+0

这与第一个版本的差异是在KeyVault证书存在之前创建的。所以我不能遵循同样的过程。我看到的唯一选项是1)使用OpenSSL将私钥与新签名的证书相结合,然后导入新的pfx作为更新的版本,或2)让KeyVault颁发新的CSR并将其提交给CA以生成新的签名证书。 –