Skip to content

Instantly share code, notes, and snippets.

@rido-min
Created October 11, 2019 18:23
Show Gist options
  • Save rido-min/a042df8a2d35de1b41428cfefc2e9be3 to your computer and use it in GitHub Desktop.
Save rido-min/a042df8a2d35de1b41428cfefc2e9be3 to your computer and use it in GitHub Desktop.
$c = New-SelfSignedCertificate -Subject "CN=RidoEdgeBox" -CertStoreLocation "Cert:\CurrentUser\My"
Export-Certificate -Cert $c -FilePath RidoEdgeBox.cer -Type CERT
certutil -encode .\RidoEdgeBox.cer .\RidoEdgeBox.der
bash -c "openssl x509 -in RidoEdgeBox.der -out RidoEdgeBox.cer.pem"
$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
Export-PfxCertificate -Cert $c -FilePath RidoEdgeBox.pfx -Password $mypwd
bash -c "openssl pkcs12 -in RidoEdgeBox.pfx -out RidoEdgeBox.key.pem -nodes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment