How to dump all certificates from a file?

Nan Xiao xiaonan830818 at gmail.com
Wed Apr 7 02:14:42 UTC 2021


Hi OpenSSL users,

Greetings from me! By default openssl-x509 can only dump one
certificate from the file:

# openssl x509 --in /etc/ssl/cacert.pem --text --noout
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            84:82:2c:5f:1c:62:d0:40
        Signature Algorithm: sha256WithRSAEncryption
......

I checked the code
(https://github.com/openssl/openssl/blob/493e78986f9677c2b321273da51c276b9a8182d8/apps/lib/apps.c#L945):
it seems openssl-x509 only dumps the first valid one. I also went
through the manual
(https://www.openssl.org/docs/man1.1.1/man1/openssl-x509.html), and
can't find a method to dump all certificates.

Could anyone give some clues in dumping all certificates from a file?
Thanks very much in advance!

Best Regards
Nan Xiao


More information about the openssl-users mailing list