Print all certificates in a file

This command is especially helpful if you want to use Tomcat-/Java-Keystore-Certificates with the Apache webserver. Use the -print_certs to print all the certificates and then cut the file and store each certificate in a single file.

 openssl pkcs7 -in file.pem -print_certs -out certs.pem

Informations about the used arguments from the OpenSSL man page: