How to Use Azure Key Vault with a DigiCert Code Signing Certificate
This guide walks you through:
- Generating a code signing CSR in Azure Key Vault (AKV)
- Ordering a DigiCert Code Signing Certificate from GeoCerts
- Merging the issued certificate back into Azure Key Vault for secure signing
Step 1: Generate a CSR in Azure Key Vault
A. Create or Use an Existing Key Vault
- In the Azure Portal, go to Key Vaults > + Create.
- Make sure to select the Premium pricing tier (required for HSM-backed keys).
- Once created, go to the vault and assign yourself the Key Vault Administrator role via Access Control (IAM).
B. Generate a Certificate Placeholder and CSR
- Inside your Key Vault, go to Certificates > + Generate/Import > Generate.
- Configure as follows:
- Method: Certificate issued by a non-integrated CA
- Name: (e.g., MyCodeSignCert)
- Subject: CN=Your Organization Name
- Content Type: PKCS #12
- Expand Advanced Policy Configuration:
- Key Type: RSA-HSM
- Key Size: 3072 or 4096
- Exportable: No
- Enhanced Key Usage (EKU): Add 1.3.6.1.5.5.7.3.3 (Code Signing)
- Click Create.
C. Download the CSR
- Once the certificate operation is in a “Pending” state, select the certificate.
- Go to Certificate Operation > Download CSR.
- Save this .csr file to your local machine — you’ll need it for the GeoCerts order.
Step 2: Order a DigiCert Code Signing Certificate from GeoCerts
- Go to your GeoCerts account, and click New Certificate.
- Choose either:
- OV Code Signing Certificate, or
- EV Code Signing Certificate
- Paste in the CSR you downloaded from Azure Key Vault.
- Complete the order and submit.
Step 3: Wait for Issuance and Download the Certificate
- Once the certificate is issued, GeoCerts will notify you.
- Log in to your GeoCerts account and click your certificate’s Order ID.
- Click Download Certificate Files.
- Select the file format:
- Recommended: PKCS #7 (.p7b) bundle — includes the leaf certificate and intermediate chain.
Step 4: Merge the Certificate into Azure Key Vault
- Return to Azure Key Vault > Certificates > your pending certificate.
- Under Certificate Operation, choose Merge Signed Request.
- Upload the .p7b file (or a single PEM/CRT file containing the full chain).
- Click Merge to complete the process.
⚠️ Do not delete or regenerate the original certificate placeholder. The merge must happen on the exact certificate object that generated the CSR, or the private key will not match.
Optional: Sign Code Using AzureSignTool
Once merged, the certificate is ready for secure code signing with an HSM-backed private key. Here’s a sample command using AzureSignTool:
AzureSignTool sign \ -kvu https://<your-vault-name>.vault.azure.net/ \ -kvc MyCodeSignCert \ -kvi <client-id> \ -kvs <client-secret> \ -kvt <tenant-id> \ -tr http://timestamp.digicert.com \ -v yourApp.exe
Pro Tips
- Premium Key Vault + RSA-HSM + non-exportable is required for EV compliance.
- The merge must happen on the same Key Vault cert object that generated the CSR.
- Always use a full chain (P7B or concatenated PEM) for merging into AKV.
- Do not rekey or create a new CSR unless you intend to start a new order.