Skip to content

Commit

Permalink
Update run.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
srozemuller committed May 30, 2024
1 parent 411028c commit e1ca5c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Security-BreakGlassCertRenewer/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ try {
# Convert the secret value to a byte array
$certBytes = [System.Convert]::FromBase64String($status.cer)
# Create a new X509Certificate2 object using the byte array and password
$x509Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList ($certBytes, $certPassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
$x509Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList ($certBytes, $env:certPassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
# Export the certificate with the private key
$pfxBytes = $x509Cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pfx, $certPassword)
$pfxBytes = $x509Cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pfx, $env:certPassword)
$certFilePath = "certificate.pfx"
# Write the byte array to a file
[System.IO.File]::WriteAllBytes($certFilePath, $pfxBytes)
Expand Down

0 comments on commit e1ca5c7

Please sign in to comment.