I have a certificate file in DER format and a key file also in DER format, the key is encrypted.
I would like to create a cer file containing both cert and encrypted key in PEM format, something like:
-----BEGIN CERTIFICATE-----
asdasdasd
-----END CERTIFICATE-----
-----BEGIN ENCRYPTED PRIVATE KEY-----
asdasdasd
-----END ENCRYPTED PRIVATE KEY-----
I can get the cert in PEM format with the following command:
openssl x509 -inform DER -in ./cert.cer -outform PEM
Also I can get the UNENCRYPTED key in PEM format with the command:
openssl pkcs8 -inform DER -in ./key.key -outform PEM -passin pass:WXYZ
This creates a file that starts with:
-----BEGIN RSA PRIVATE KEY-----
However I can not find a way to make it start with
-----BEGIN ENCRYPTED PRIVATE KEY-----
So that I can just concatenate both files and get the cert.
Do you know what can I do?