openssl does not generate certificate with PKCS#1 key format in RHEL 9

Solution Unverified - Updated -

Issue

  • We are experiencing issues converting from PKCS8 to PKCS1 on RHEL 9 servers.
  • We are using the following command:

    [root@localhost ~]# openssl rsa -in input.key -out output.rsa.key
    
  • The input file looks like this:

    [root@localhost ~]# cat input.key
    -----BEGIN PRIVATE KEY-----
    MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCflwydaSdwbKWa
    [...]
    teLV0p8/NVJdaNM2XMisR+Xt
    -----END PRIVATE KEY-----
    
  • The resulting output file looks like this:

    [root@localhost ~]# cat output.rsa.key
    -----BEGIN PRIVATE KEY-----
    MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCflwydaSdwbKWa
    [...]
    teLV0p8/NVJdaNM2XMisR+Xt
    -----END PRIVATE KEY-----
    
  • The output file does not match the expected headers:

    -----BEGIN RSA PRIVATE KEY-----
    [...]
    -----END RSA PRIVATE KEY-----
    
  • We tested the same command in RHEL 7 and there we have the RSA PRIVATE KEY headers.

Environment

  • Red Hat Enterprise Linux 9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content