0

I'm trying to import a certificate for my school network that ends in .cer, and ubuntu seems happy to read the data, but the import button is greyed out. I've seem similar questions, but none seem to quite apply to this situation, does anyone have any clues?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 30 '23 at 20:40
  • Please read https://askubuntu.com/help/how-to-ask and https://askubuntu.com/help/formatting . Take the [tour]. – waltinator Nov 30 '23 at 21:08

1 Answers1

0

The certificates usually come in two formats, PEM and DER. You can recognize them when you try to look at them as text, for example using the command less filename.cer. PEM certificates appear as readable (although cryptic) text that begins with a line -----BEGIN CERTIFICATE----- or similar. DER certificates are in binary format and the less command will warn you that the file is binary and ask if you really want to view it.

It is possible that your file is in one format while your application (the one with "Import" button you mentioned, I don't know which one it is, because you didn't provide that information) needs a certificate in the other format. To convert between formats, you need the openssl program. Type:

openssl x509 -inform der -in filename.cer -out filename.pem

to convert from DER to PEM, or

openssl x509 -outform der -in filename.cer -out filename.der

to convert from PEM to DER.

If the openssl program is not installed, you can install it with the command: sudo apt install openssl.

raj
  • 10,353