Certificate Enrollment
Overview
Export certificates from Vault PKI in PKCS#12 format and import into Windows Certificate Store.
Prerequisites
-
Vault CLI installed and configured
-
Access to Vault PKI (
pki_int/issue/domus-clientrole) -
jqandopensslinstalled
Step 1: Issue Certificate from Vault
Run from a Linux workstation with Vault access (not from the Windows machine).
Set Variables
# Load Vault secrets
dsource d000 dev/vault
# Target hostname (change this to your Windows machine name)
HOSTNAME="win-pc-01"
DOMAIN="inside.domusdigitalis.dev"
HOSTNAME="modestus-surface"
DOMAIN="inside.domusdigitalis.dev"
Issue Certificate (1-year TTL)
vault write -format=json pki_int/issue/domus-client \
common_name="${HOSTNAME}.${DOMAIN}" \
ttl="8760h" > /tmp/${HOSTNAME}-cert.json
Step 2: Create PKCS#12 Bundle
Windows requires PKCS#12 (.pfx) format for certificate import.
Set Password
# Use a strong password (you'll need this on the Windows side)
PFX_PASS="$(openssl rand -base64 16)"
echo "PFX Password: ${PFX_PASS}"
| Save this password - you’ll need it when importing on Windows. |
Step 3: Transfer to Windows
Copy files to the Windows machine.
Option A: SCP (from Linux workstation)
# Copy PFX to Windows machine (via SSH if available)
scp /tmp/${HOSTNAME}.pfx administrator@${HOSTNAME}:C:/Temp/
# Also copy CA chain for trust store
scp /tmp/${HOSTNAME}-chain.crt administrator@${HOSTNAME}:C:/Temp/
Step 4: Import Certificate (PowerShell)
Run PowerShell as Administrator on the Windows machine.
Set Variables
# Change this to match your hostname
$Hostname = "win-pc-01"
$PfxPath = "C:\Temp\$Hostname.pfx"
$ChainPath = "C:\Temp\$Hostname-chain.crt"
# Enter the PFX password from Step 2
$PfxPassword = Read-Host -AsSecureString "Enter PFX Password"
Import Client Certificate
# Import to Local Machine Personal store
Import-PfxCertificate -FilePath $PfxPath `
-CertStoreLocation Cert:\LocalMachine\My `
-Password $PfxPassword
Expected output shows certificate thumbprint:
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Thumbprint Subject
---------- -------
A1B2C3D4E5F6... CN=win-pc-01.inside.domusdigitalis.dev
Step 5: Import CA Chain
Import the issuing CA to the Intermediate store and root to Trusted Root.
# Import CA chain (contains both issuing and root)
Import-Certificate -FilePath $ChainPath `
-CertStoreLocation Cert:\LocalMachine\CA
Step 6: Verify Import
Verify Certificates
Check Client Certificate
# List certificates in Personal store
Get-ChildItem Cert:\LocalMachine\My | Format-Table Subject, NotAfter, Thumbprint
# Check specific cert details
Get-ChildItem Cert:\LocalMachine\My | Where-Object {{ $_.Subject -like "*inside.domusdigitalis.dev*" }} | Format-List *
# Verify certificate has private key
Get-ChildItem Cert:\LocalMachine\My | Where-Object {{ $_.HasPrivateKey }}
# Check EKU includes Client Authentication
Get-ChildItem Cert:\LocalMachine\My | ForEach-Object {{
$_.EnhancedKeyUsageList | Where-Object {{ $_.FriendlyName -eq "Client Authentication" }}
}}
Additional Verification
# Verify certificate chain is valid
$cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -like "*$Hostname*"
$chain = New-Object System.Security.Cryptography.X509Certificates.X509Chain
$chain.Build($cert)
$chain.ChainStatus | Format-Table Status, StatusInformation
# Expected: Empty (no errors) or "RevocationStatusUnknown" (acceptable without CRL)
Cleanup
Troubleshooting
Certificate Not Appearing
# Check if certificate was imported
Get-ChildItem Cert:\LocalMachine\My | Format-Table Subject, Thumbprint
# If empty, re-run import with verbose
Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\LocalMachine\My -Password $PfxPassword -Verbose
"The PFX file is protected" Error
Password mismatch. Verify the password from Step 2:
# Test with plaintext password (for debugging only)
$PlainPwd = "your-password-here"
$SecurePwd = ConvertTo-SecureString -String $PlainPwd -Force -AsPlainText
Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\LocalMachine\My -Password $SecurePwd
See Also
-
TEAP Configuration - Configure EAP method
-
GPO Configuration - Deploy via Group Policy
-
Manual Configuration - Per-machine setup
-
Troubleshooting - Debug 802.1X issues