Skip to content

Commit

Permalink
Update Generate-UserCert.ps1
Browse files Browse the repository at this point in the history
remove extra ')'
  • Loading branch information
jworkmanjc authored Mar 10, 2023
1 parent e02ed7a commit 920c23d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Generate-UserCert {

# take signing request, make cert # specify extensions requets
Write-Host "[status] take signing request, make cert # specify extensions requets"
Invoke-Expression "$opensslBinary x509 -req -extfile $ExtensionPath -days $JCUSERCERTVALIDITY -in $userCSR -CA $rootCA -CAkey $rootCAKey -passin pass:$($env:certKeyPassword)) -CAcreateserial -out $userCert -extensions v3_req"
Invoke-Expression "$opensslBinary x509 -req -extfile $ExtensionPath -days $JCUSERCERTVALIDITY -in $userCSR -CA $rootCA -CAkey $rootCAKey -passin pass:$($env:certKeyPassword) -CAcreateserial -out $userCert -extensions v3_req"

# validate the cert we cant see it once it goes to pfx
Write-Host "[status] validate the cert we cant see it once it goes to pfx"
Expand All @@ -65,7 +65,7 @@ function Generate-UserCert {
# Create Client cert with email in the subject distinguished name
Invoke-Expression "$opensslBinary genrsa -out $userKey 2048"
# Generate User CSR
Invoke-Expression "$opensslBinary req -nodes -new -key $rootCAKey -passin pass:$($env:certKeyPassword)) -out $($userCSR) -subj /C=$($subj.countryCode)/ST=$($subj.stateCode)/L=$($subj.Locality)/O=$($JCORGID)/OU=$($subj.OrganizationUnit)/CN=$($subj.CommonName)"
Invoke-Expression "$opensslBinary req -nodes -new -key $rootCAKey -passin pass:$($env:certKeyPassword) -out $($userCSR) -subj /C=$($subj.countryCode)/ST=$($subj.stateCode)/L=$($subj.Locality)/O=$($JCORGID)/OU=$($subj.OrganizationUnit)/CN=$($subj.CommonName)"
Invoke-Expression "$opensslBinary req -new -key $userKey -out $userCsr -config $ExtensionPath -subj `"/C=$($subj.countryCode)/ST=$($subj.stateCode)/L=$($subj.Locality)/O=$($JCORGID)/OU=$($subj.OrganizationUnit)/CN=/emailAddress=$($user.email)`""

# Gennerate User Cert
Expand Down Expand Up @@ -104,4 +104,4 @@ function Generate-UserCert {
# }

}
}
}

0 comments on commit 920c23d

Please sign in to comment.