0

I run these command to generate private and public keys :

openssl genrsa -out keypair.pem 2048 openssl rsa -in keypair.pem -pubout -out publickey.crt 

and then I tried to view certicate information using

openssl x509 -text -in publickey.crt -noout 

but I am getting this error:

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

any idea of why and how can I manage to view the certificate ?

Thanks

2
  • 1
    You have generated private and public keys but not any certificate. Commented May 22, 2023 at 16:02
  • @admstg Why don't you make that an answer? Commented May 22, 2023 at 20:46

1 Answer 1

2

You have generated private and public keys but not any certificate.

You need to create a certificate request with openssl req -key keypair.pem -new -out domain.csr then else autosign the certificate with openssl x509 -signkey dkeypair.pem -in domain.csr -req -days 365 -out domain.crt or request your PKI to sign the .csr

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.