I'm looking for a way to create an AES-128 key in PEM format (Base64 encoded text file) using PowerShell. All the examples I can find assume the user has OpenSSL installed. The equivalent OpenSSL command would be:
openssl genrsa -aes128 -out mykey.pem 4096
Is there a way to generate the equivalent file using any of the built in PowerShell cmdlets, such as Export-Certificate
or New-SelfSignedCertificate
or anything? Or, as a last resort, a solution involving calling into the .NET Framework? I'd appreciate any examples. Thanks!