summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeon Lackey <dlackey@redhat.com>2010-08-19 18:45:28 -0400
committerDeon Lackey <dlackey@redhat.com>2010-08-19 18:45:28 -0400
commit4031dc951c316da57f6b72b38175808f92a12ba6 (patch)
treea5b7dbe8559f3e46b6dac0bcff02443ab2f8142e
parent832c228cad1c06077f6080e0bb8c20646e1ec687 (diff)
downloadrepo-4031dc951c316da57f6b72b38175808f92a12ba6.tar.gz
repo-4031dc951c316da57f6b72b38175808f92a12ba6.tar.xz
repo-4031dc951c316da57f6b72b38175808f92a12ba6.zip
finishing up first draft
-rw-r--r--pk12util.xml183
1 files changed, 157 insertions, 26 deletions
diff --git a/pk12util.xml b/pk12util.xml
index 93b8344..e5f0200 100644
--- a/pk12util.xml
+++ b/pk12util.xml
@@ -36,26 +36,31 @@ common-options are:
<refsection id="description">
<title>Description</title>
- <para><command>pk12util</command> is an interactive command-line tool which can be used to export keys and certificates from an nss database to a pkcs #12 file or import from one such file into the database. It can also list the contents of a pkcs #12 file. </para>
+ <para>The PKCS #12 utility, <command>pk12util</command>, enables sharing certificates among any server that supports PKCS#12. The tool can import certificates and keys from PKCS#12 files into security databases, export certificates, and list certificates and keys.</para>
</refsection>
<refsection id="options">
- <title>Options</title>
+ <title>Options and Arguments</title>
+ <para><command>Options</command></para>
<variablelist>
<varlistentry>
<term>-i p12file</term>
- <listitem><para>Import keys and certs from p12file into the nss database.</para></listitem>
+ <listitem><para>Import keys and certificates from a PKCS#12 file into a security database.</para></listitem>
</varlistentry>
<varlistentry>
<term>-l p12file</term>
- <listitem><para>List the keys and certs in p12file.</para></listitem>
+ <listitem><para>List the keys and certificates in PKCS#12 file.</para></listitem>
</varlistentry>
<varlistentry>
<term>-o p12file</term>
- <listitem><para>Export keys and certs from the nss database to 12file.</para></listitem>
+ <listitem><para>Export keys and certificates from the security database to a PKCS#12 file.</para></listitem>
</varlistentry>
+ </variablelist>
+
+ <para><command>Arguments</command></para>
+ <variablelist>
<varlistentry>
<term>-n certname</term>
@@ -123,39 +128,165 @@ common-options are:
</varlistentry>
<varlistentry>
- <term>-m | --cert-key-len certKeyLength</term>
+ <term>-n | --cert-key-len certKeyLength</term>
<listitem><para>Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>-r</term>
+ <listitem><para>Dumps all of the data in raw (binary) form. This must be saved as a DER file. The default is to return information in ASCII (a PEM file).</para></listitem>
+ </varlistentry>
</variablelist>
</refsection>
- <refsection id="basic-usage">
- <title>Basic Usage</title>
- <para>The following example will do <emphasis>this</emphasis> and that
- </para>
-<programlisting>% blah blah
- line 2
- line 3</programlisting>
-<!-- i'm working on a decent way to do embedded subsections; for now, just use a bold tag to show a new section -->
- <para><command>Subsection</command></para>
- <para>
- sentence #2
- </para>
- <para>
- sentence #3
- </para>
+ <refsection id="return-codes">
+ <title>Return Codes</title>
+ <para> * 0 - No error</para>
+ <para> * 1 - User Cancelled</para>
+ <para> * 2 - Usage error</para>
+ <para> * 6 - NLS init error</para>
+ <para> * 8 - Certificate DB open error</para>
+ <para> * 9 - Key DB open error</para>
+ <para> * 10 - File initialization error</para>
+ <para> * 11 - Unicode conversion error</para>
+ <para> * 12 - Temporary file creation error</para>
+ <para> * 13 - PKCS11 get slot error</para>
+ <para> * 14 - PKCS12 decoder start error</para>
+ <para> * 15 - error read from import file</para>
+ <para> * 16 - pkcs12 decode error</para>
+ <para> * 17 - pkcs12 decoder verify error</para>
+ <para> * 18 - pkcs12 decoder validate bags error</para>
+ <para> * 19 - pkcs12 decoder import bags error</para>
+ <para> * 20 - key db conversion version 3 to version 2 error</para>
+ <para> * 21 - cert db conversion version 7 to version 5 error</para>
+ <para> * 22 - cert and key dbs patch error</para>
+ <para> * 23 - get default cert db error</para>
+ <para> * 24 - find cert by nickname error</para>
+ <para> * 25 - create export context error</para>
+ <para> * 26 - PKCS12 add password itegrity error</para>
+ <para> * 27 - cert and key Safes creation error</para>
+ <para> * 28 - PKCS12 add cert and key error</para>
+ <para> * 29 - PKCS12 encode error</para>
</refsection>
<refsection id="examples">
- <title>Extended Examples</title>
- <para>The following example will do this and that
+ <title>Examples</title>
+ <para><command>Importing Keys and Certificates</command></para>
+ <para>The most basic usage of <command>pk12util</command> for importing a certificate or key is the PKCS#12 input file (<option>-i</option>) and some way to specify the security database being accessed (either <option>-d</option> for a directory or <option>-h</option> for a token).
+ </para>
+<programlisting language="Bash">pk12util -i p12File [-h tokenname] [-v] [-d dir] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</programlisting>
+ <para>For example:</para>
+<programlisting language="Bash"># pk12util -i /tmp/cert-files/users.p12 -d /etc/pki/nssdb/
+
+Enter a password which will be used to encrypt your keys.
+The password should be at least 8 characters long,
+and should contain at least one non-alphabetic character.
+
+Enter new password:
+Re-enter password:
+Enter password for PKCS12 file:
+pk12util: PKCS12 IMPORT SUCCESSFUL</programlisting>
+
+ <para><command>Exporting Keys and Certificates</command></para>
+ <para>Using the <command>pk12util</command> command to export certificates and keys requires both the name of the certificate to extract from the database (<option>-n</option>) and the PKCS#12-formatted output file to write to. There are optional parameters that can be used to encrypt the file to protect the certificate material.
+ </para>
+<programlisting>pk12util -o p12File -n certname [-c keyCipher] [-C certCipher] [-m|--key_len keyLen] [-n|--cert_key_len certKeyLen] [-d dir] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</programlisting>
+ <para>For example:</para>
+<programlisting language="Bash"># pk12util -o certs.p12 -n Server-Cert -d /etc/pki/nssdb/
+Enter password for PKCS12 file:
+Re-enter password: </programlisting>
+
+ <para><command>Listing Keys and Certificates</command></para>
+ <para>The information in a <filename>.p12</filename> file are not human-readable. The certificates and keys in the file can be printed (listed) in a human-readable ASCII format or can be printed in a DER binary format (<option>-r</option>) so that the output can be fed to another application, like OpenSSL.
</para>
-<programlisting>% blah blah</programlisting>
+<programlisting>pk12util -l p12File [-h tokenname] [-r] [-d dir] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</programlisting>
+ <para>For example, this prints the default ASCII output:</para>
+<programlisting language="Bash"># pk12util -l certs.p12
+
+Enter password for PKCS12 file:
+Key(shrouded):
+ Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID
+
+ Encryption algorithm: PKCS #12 V2 PBE With SHA-1 And 3KEY Triple DES-CBC
+ Parameters:
+ Salt:
+ 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f
+ Iteration Count: 1 (0x1)
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 13 (0xd)
+ Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption
+ Issuer: "E=personal-freemail@thawte.com,CN=Thawte Personal Freemail C
+ A,OU=Certification Services Division,O=Thawte Consulting,L=Cape T
+ own,ST=Western Cape,C=ZA"
+....</programlisting>
+ <para>For example, this uses the <option>-r</option> argument to output the DER information:</para>
+<programlisting language="Bash"># pk12util -l test.p12 -r
+Enter password for PKCS12 file:
+Key(shrouded):
+ Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID
+
+ Encryption algorithm: PKCS #12 V2 PBE With SHA-1 And 3KEY Triple DES-CBC
+ Parameters:
+ Salt:
+ 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f
+ Iteration Count: 1 (0x1)
+Certificate Friendly Name: Thawte Personal Freemail Issuing CA - Thawte Consulting
+
+Certificate Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID</programlisting>
+ </refsection>
+
+ <refsection id="encryption">
+ <title>Password Encryption</title>
+ <para>PKCS#12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. Password-based encryption is used to protect private keys on export to a PKCS#12 file and, optionally, the entire package. If no algorithm is specified, the tool defaults to using <command>PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</command> for private key encryption. <command>PKCS12 V2 PBE with SHA1 and 40 Bit RC4</command> is the default for the overall package encryption when not in FIPS mode. When in FIPS mode, there is no package encryption.</para>
+ <para>The private key is always protected with strong encryption by default.</para>
+ <para>Several types of ciphers are supported.</para>
+ <variablelist>
+
+ <varlistentry>
+ <term>Symmetric CBC ciphers for PKCS#5 V2</term>
+ <listitem><para>* DES_CBC</para>
+ <para>* RC2-CBC</para>
+ <para>* RC5-CBCPad</para>
+ <para>* DES-EDE3-CBC (the default for key encryption)</para>
+ <para>* AES-128-CBC</para>
+ <para>* AES-192-CBC</para>
+ <para>* AES-256-CBC</para>
+ <para>* CAMELLIA-128-CBC</para>
+ <para>* CAMELLIA-192-CBC</para>
+ <para>* CAMELLIA-256-CBC</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>PKCS#12 PBE ciphers</term>
+ <listitem><para>* PKCS #12 PBE with Sha1 and 128 Bit RC4</para>
+ <para>* PKCS #12 PBE with Sha1 and 40 Bit RC4</para>
+ <para>* PKCS #12 PBE with Sha1 and Triple DES CBC</para>
+ <para>* PKCS #12 PBE with Sha1 and 128 Bit RC2 CBC</para>
+ <para>* PKCS #12 PBE with Sha1 and 40 Bit RC2 CBC</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 128 Bit RC4</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 40 Bit RC4 (the default for non-FIPS mode)</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 2KEY Triple DES-cbc</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 128 Bit RC2 CBC</para>
+ <para>* PKCS12 V2 PBE with SHA1 and 40 Bit RC2 CBC</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>PKCS#5 PBE ciphers</term>
+ <listitem><para>* PKCS #5 Password Based Encryption with MD2 and DES CBC</para>
+ <para>* PKCS #5 Password Based Encryption with MD5 and DES CBC</para>
+ <para>* PKCS #5 Password Based Encryption with SHA1 and DES CBC</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <para>With PKCS#12, the crypto provider may be the soft token module or an external hardware module. If the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default). If no suitable replacement for the desired algorithm can be found, the tool returns the error <emphasis>no security module can perform the requested operation</emphasis>.</para>
</refsection>
<refsection id="seealso">
<title>See Also</title>
- <para> % reference to other tool here %</para>
+ <para>certutil (1)</para>
+ <para>modutil (1)</para>
</refsection>
<!-- don't change -->
@@ -172,7 +303,7 @@ common-options are:
<title>Authors</title>
<para>The NSS tools were written and maintained by developers with Netscape and now with Red Hat.</para>
<para>
- Authors: Elio Maldonado &lt;emaldona@redhat.com>, Deon Lackey &lt;dlackey@redhat.com>, Gerhardus Geldenhuis &lt;gerhardus.geldenhuis@gmail.com>.
+ Authors: Elio Maldonado &lt;emaldona@redhat.com>, Deon Lackey &lt;dlackey@redhat.com>.
</para>
</refsection>