The attached patch addresses the following PKI issues:
Note that this implementation of ticket #398 chose a slightly different default for the client directory path, "~/.pki/<pki_instance_id>_<pki_subsystem>" rather than the suggested "~/.pki/certs/<instance>", so that the existing option to purge the client directory could still be used as is to completely remove this entire directory structure.