0

My question is simply: What is the encoding of the .pem and .csr file created by openssl using this command:

openssl req -nodes -newkey rsa:2048 -keyout key.pem -out some.csr \
    -subj "/C=XY/ST=UVW/L=SOMETOWN/O=STH/OU=STHELSE/CN=my.cert.test"

I do past some information from which i do not know if they are of importance for the answer of this question:

I am working on a xterm under x11. I have a up to date linux distribution (opensuse leap 42.2) and use openssl in my shell to create a csr file. I have a setting in my env XTERM_LOCALE=de_DE.UTF-8.

jww
  • 97,681
  • 90
  • 411
  • 885
Matthias
  • 3,458
  • 4
  • 27
  • 46
  • 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 Oct 26 '16 at 19:02
  • To answer your question, `key.pem` and `some.csr` are both PEM encoded. But why did you need to ask the question here? A simple `cat key.pem` or `cat some.csr` would have answered your question. – jww Oct 26 '16 at 19:05
  • You might also want to look at [How do you sign Certificate Signing Request with your Certification Authority](http://stackoverflow.com/a/21340898/608639) and [How to create a self-signed certificate with openssl?](http://stackoverflow.com/q/10175812/608639) – jww Oct 26 '16 at 19:07
  • @offtopic: the certificate is the data my software operates on. Is the question still off topic? – Matthias Oct 26 '16 at 20:10
  • When i cat the file how do i know the encoding? – Matthias Oct 26 '16 at 20:11

1 Answers1

0

You can set encoding by passing -outform DER or -outform PEM where der is binary file and pem is in base64.

Marek Klein
  • 1,410
  • 12
  • 20