The pk12util command-line utility imports and exports both keys and certificates, defined by the PKCS #12 standard, to and from their respective database and file formats. More information on pk12util can be found at:
http://www.mozilla.org/projects/security/pki/nss/tools/pk12util.html