Last active
April 3, 2021 15:46
-
-
Save georgechang/4e233ce3e5005dfb3309a27ab0d2f0c3 to your computer and use it in GitHub Desktop.
Create crt/key files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-SelfSignedCertificate -DnsName domain.com -CertStoreLocation Cert:\LocalMachine\My -KeyExportPolicy Exportable -NotAfter (Get-Date).AddYears(3) | Export-PfxCertificate -FilePath .\cert.pfx -Password (ConvertTo-SecureString -String "secret" -AsPlainText -Force) | |
openssl pkcs12 -in cert.pfx -nocerts -out cert.key | |
openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment