6

I am looking for a way to restore openssl configuration from an X509 certificate (or a csr). I know it's possible to look at the certificate and manually reconstruct the config file but it's unreliable and requires too much labor :P.

Any suggestions?

cyc115
  • 163
  • 6

2 Answers2

3

No, there is no builtin functionality in openssl, which allows to reconstruct the configuration used to create a certificate from the certificate alone.

This would be an impossible task, since there are quite a few administrative settings in the config file, which are not contained in the resulting certificate (like the actual openssl command used, paths and filenames, naming policy, ...).

mat
  • 548
  • 6
  • 20
0

XCA (small OpenSource Java PKI tool) supports exporting a X509 certificate as OpenSSL config template. Maybe does not cover all use cases, but it's probably a good start.

Just import the cert to the XCA database (e.g. drag and drop), right-click -> Export -> OpenSSL Config.

https://hohnstaedt.de/xca-doc/xca-9.html#ss9.4

Oliver M.
  • 101