【问题标题】:How do you manually renew a certificate in AzureKeyValut如何在 AzureKeyValut 中手动更新证书
【发布时间】:2017-11-21 20:54:25
【问题描述】:

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

【问题讨论】:

    标签: azure ssl azure-keyvault


    【解决方案1】:

    所以关闭上面的评论,我能够让它工作。

    #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'
    

    【讨论】:

      【解决方案2】:

      Azure Key Vault 证书是一个版本化对象。创建新证书时,您将创建一个新版本。每个版本的证书在概念上都由两部分组成 - 一个非对称密钥和一个将非对称密钥与身份相关联的 blob。

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

      如果您当前的版本即将到期,您需要创建一个新版本。您需要遵循与创建第一个版本时相同的步骤。您可以选择在创建新版本时选择使用相同的非对称密钥。

      【讨论】:

      • 这与第一个版本的区别是在 KeyVault 证书存在之前创建的。所以我不能遵循相同的过程。我看到的唯一选项 1) 是使用 OpenSSL 将私钥与新签名的证书结合起来,然后将该新 pfx 作为更新版本导入,或者 2) 让 KeyVault 发出新的 CSR 并将其提交给 CA 以生成从中获得新的签名证书。?
      猜你喜欢
      • 2019-08-17
      • 2018-05-31
      • 1970-01-01
      • 2021-12-26
      • 2016-10-08
      • 2021-01-27
      • 2021-06-12
      • 2020-10-17
      • 2020-07-11
      相关资源
      最近更新 更多