Start cleaning up and fixing smime_keys.pl (closes #3324) (see #2456)
* Convert to using File::Temp (#3324). This was also suggested at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775199
* Use File::Temp for add_p12 temp file. (#2456)
* Make the query_label() method a bit more robust with empty strings,
ctrl-d, and leading spaces.
* Clean up openssl_do_verify() logic. Mark cert as invalid
rather that die'ing if an openssl verify command fails.
* General cleanup:
- Clearly separate op handler, certificate management, and helper
functions by section and using prefixes.
- Create openssl helper functions to reduce copy/paste invocations
and make the code clearer.
- Make indentation consistent at 2 spaces.
- Change handle_add_pem() to re-use handle_add_chain() once the
correct files are identified.
- Change openssl_parse_pem() to return a single array of data
structures representing the parsed certs/keys.