CER/DER to PEM, extracting key from certificate

extraction key from cert(if it is allowed): openssl pkcs12 -in CertificateWithKey.pfx -out EncryptedCertificateKEY.key decrypting key: openssl rsa -in EncryptedCertificateKEY.key -out UNEncryptedCertificateKEY.key convert cer to pem: openssl x509 -inform der -in Certificate.cer -out Certificate.pem