0

I working on a project that uses JSON Web Tokens (JWT). I already have the code that creates the token that is signed by an RSA algorithm which was created by the openssl genrsa -des3 -out <private key file name>.pem 3076. I want to check the validity of the tokens I produce on the jwt.io website, but i need "[public/private] Key in...X.509 certificate, or JWK string format".

Format of private key:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,4AE3D092CB847166

(The actual key)

-----END RSA PRIVATE KEY-----

Format of public key:

-----BEGIN PUBLIC KEY-----

(The actual key)

-----END PUBLIC KEY-----

Is there any command/tools that can be used to convert these into X.509 certificates or JWK strings?

I have already tried using the openssl x509 -in <public or private key file name>.pem -inform PEM -out <X509 certificate file name>.der -outform DER command.

That would always return this error:

unable to load certificate
140258002609472: error: 0909006C: PEM routines: get_name:no start line:../crypto/pem/pem lib.c:745: Expecting: TRUSTED CERTIFICATE

All of the commands have been run using the terminal from a replit project. I am not sure if that plays a role or not but I mention it just in case.

President James K. Polk
  • 40,516
  • 21
  • 95
  • 125

1 Answers1

0

Do you use Windows? Check the encoding. Change to UTF-8 through the Notepad and create it.

devel.
  • 1
  • 2