5

I am trying to generate a private-public key pair and convert the public key into a certificate which can be added into my truststore.

To generate private & public key: openssl rsa -in private.pem -outform PEM -pubout -out public_key.pem

Now I am trying to convert this to a certificate:

openssl x509 -outform der -in  public_key.pem -out  public.cer 

But I get an error:

7962:error:0906D06C:PEM routines:PEM_read_bio:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.30.2/src/crypto/pem/pem_lib.c:648:Expecting: TRUSTED CERTIFICATE

All tutorials show that I have to convert pem to crt before adding to a truststore.

user1692342
  • 5,007
  • 11
  • 69
  • 128
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Feb 08 '17 at 17:07
  • FYI this is the same problem as in the comments of https://stackoverflow.com/a/14484363. They don't seem to answer the question, tho. – dfrankow Nov 04 '21 at 21:05

0 Answers0