Adds support for export-p7 and nokey option for export-p12

added command export-p7 to export certs using pkcs7 format.
added option nokey for pkcs12 to avoid exporting private keys
fixed issues related by Josh Cepek
(rebased from upstream)