This commit is contained in:
Zack Meier
2026-04-15 15:45:50 -05:00
commit 1d304511b8
613 changed files with 140998 additions and 0 deletions
@@ -0,0 +1,39 @@
function Test-SectigoCertificateRequest {
[CmdletBinding(SupportsShouldProcess=$true)]
param (
[string]$FilePath,
[string]$csr
)
if ($FilePath) {
[string]$csr = (Get-Content -Path $FilePath -Raw)
}
[string]$dcvUrl = "https://certificates.nd.gov/api/csr/validate/string"
$headers = @{
"accept" = "application/json"
"Content-Type" = "application/json" # <-- Cleaned up syntax
}
$Body = @{
"csr" = $csr
}
$jsonBody = $body | ConvertTo-Json
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# --- API Call ---
Write-Verbose "Attempting to retrieve certificate for Order ID: $OrderId"
try {
$response = Invoke-RestMethod -Uri $dcvUrl -Method Post -Headers $headers -Body $jsonBody
$response
} catch {
Write-Error "API Request Failed: $($_.Exception.Message)"|convertfrom-json
return $null
}
}