DigiCert CertCentral APIキーを作成し、組織IDとCertCentralアカウントIDを取得したら、Azure Key VaultアカウントからのデジサートのSSL/TLSサーバ証明書のオーダーを開始できます。
証明書をオーダーするには、Azure PowerShellバージョン2.1.0を使用してください。このバージョンのPowerShellがない場合は、
https://github.com/Azure/azure-powershell/releases/tag/v2.1.0-September2016でアクセスできます。
これらのAzure PowerShellコマンドの実行中に問題が発生した場合は、Microsoftアカウント担当者にお問い合わせください。
注記
CertCentralへのAzure Key Vaultの統合は、SSL/TLSサーバ証明書のオーダーのみをサポートしています。
これらの手順における変数には、参照用のサンプル値が割り当てられています。変数の値は適切に変更してください。
新しいPowerShellウインドウを開いてこのコマンドを実行し、Azure Key Vaultアカウントにログインします。
Login-AzureRMAccount
使用できるリソースグループがすでに存在する場合、新しいリソースグループを作成する必要はありません。
$resourceGroupName
と$resourceGroupLocation
変数を定義するこれらのコマンドを実行して変数を定義します。
$resourceGroupName = "myResourceGroup" $resourceGroupLocation = "West Us"
リソースグループを作成する
定義した変数を使用してこのコマンドを実行し、リソースグループを作成します。
New-AzureRMResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation
使用できるボールトがすでに存在する場合、新しいボールトを作成する必要はありません。
$vaultName
と$vaultLocation
変数を定義するこれらのコマンドを実行して変数を定義します。
$vaultName = "myVaultName" $vaultLocation = "West Us"
ボールトを作成する
定義した変数を使用してこのコマンドを実行し、ボールトを作成します。
New-AzureRmKeyVault -VaultName $vaultName -ResourceGroupName $resourceGroupName -Location $vaultLocation -Sku Premium
以下のコマンドを実行して、発行者用の組織を作成します。このコマンドは、後ほど他のコマンドで使用する$org
変数も作成します。
$org = New-AzureKeyVaultCertificateOrganizationDetails -Id OrganizationIDfromDigiCertAccount
このコマンドを実行して$secureAPIKey
変数を作成し、定義します。
$secureApiKey = ConvertTo-SecureString DigiCertCertCentralAPIKey -AsPlainText –Force
このステップでは、Azure Key VaultアカウントとDigiCert CertCentralアカウント間の接続を作成します。
$accountId
と$issuerName
変数を定義するこれらのコマンドを実行して変数を定義します。
$accountId = "myDigiCertCertCentralAccountID" $issuerName = "MyIssuerName"
発行者を作成する
定義した変数を使用してこのコマンドを実行し、発行者を作成します。
Set-AzureKeyVaultCertificateIssuer -VaultName $vaultName -IssuerName $issuerName -IssuerProvider DigiCert -AccountId $accountId -ApiKey $secureApiKey -OrganizationDetails $org
定義した変数を使用して以下コマンドを実行し、ポリシーを作成します。このコマンドは、後ほど他のコマンドで使用する$certificatePolicy
変数も作成します。
$certificatePolicy = New-AzureKeyVaultCertificatePolicy -SecretContentType application/x-pkcs12 -SubjectName "CN=myCommonName.com" -ValidityInMonths 12 -IssuerName $issuerName -RenewAtNumberOfDaysBeforeExpiry 60
$certificateName
変数を定義するこのコマンドを実行して、変数を定義します。
$certificateName = "myCertificateName"
SSL/TLSサーバ証明書を申請する
定義した変数を使用してこのコマンドを実行し、SSL/TLSサーバ証明書を申請します。
Add-AzureKeyVaultCertificate -VaultName $vaultName -CertificateName $certificateName -CertificatePolicy $certificatePolicy
定義した変数を使用して以下のコマンドを実行し、証明書申請のステータスをチェックして申請が「完了」しているかどうかを確認します。
Get-AzureKeyVaultCertificateOperation -VaultName $vaultName -CertificateName $certificateName
定義した変数を使用して以下のコマンドを実行し、発行されたSSL/TLSサーバ証明書にアクセスします。
Get-AzureKeyVaultCertificate -VaultName $vaultName -CertificateName $certificateName