11 lines
434 B
PowerShell
11 lines
434 B
PowerShell
$CR_OUT_BASE64 = 0x00000001
|
|
$CR_IN_PKCS10 = 0x00000100
|
|
$CR_DISP_ISSUED = 0x3
|
|
$ca = "ca.demo.com" # The CA name.
|
|
$certificateRequest = new-Object -com "CertificateAuthority.Request"
|
|
# Submit the request.
|
|
$disposition = $certificateRequest.Submit($CR_OUT_BASE64 -or $CR_IN_PKCS10, $signedCertificateRequest, $null, $ca)
|
|
if($disposition -match $CR_DISP_ISSUED)
|
|
{
|
|
$certificate = $certificateRequest.GetCertificate($CR_OUT_BASE64)
|
|
} |