You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



pk12util

Newsgroup: mozilla.dev.tech.crypto

SYNOPSIS

pk12util [ -d CertAndKeyDirectory ] -i Pkcs12FileNameForImport [ -a AliasForServerCertKey]
or
pk12util [ -d CertAndKeyDirectory ] -o Pkcs12FileNameForExport [ -a AliasForServerCertKey]

AVAILABILITY

Available on NT 4.0, Solaris 2.5/2.5.1/2.6, HP 10.10/10.20/11.0, AIX 4.2.

DESCRIPTION

The PKCS#12 utility makes sharing of certificates among Enterprise server 3.x and any server (Netscape products or non-Netscape products) that supports PKCS#12 possible. The following options are supported:
  • -d CertAndKeyDirectory    - Use CertAndKeyDirectory as the certificate and key database directory. When importing, certificate and key in the PKCS#12 file will be imported into the certificate and key databases in the CertAndKeyDirectory directory. When exporting, certificate and key in the certificate and key databases in the CertAndKeyDirectory directory will be exported to an PKCS#12 file.
  • This is optional. If not specified, the default directory is the current directory.
  • -i Pkcs12FileNameForImport    - Certificate and key in the PKCS#12 file, Pkcs12FileNameForImport, will be imported into the directory specified with the -d option.
  • -o Pkcs12FileNameForExport    - Certificate and key in the databases in the -d specified directory will be exported into the PKCS#12 file, Pkcs12FileNameForExport.
  • -a AliasForServerCertKey    - Since an alias is associated with an Enterprise Server certificate/key, AliasForServerCertKey will be used to hand-craft any necessary alias related update to the Enterprise Server installation.

ERROR CODES

pk12util can return the following values:

0 - No error
1 - User Cancelled
2 - Usage error
6 - NLS init error
8 - Certificate DB open error
9 - Key DB open error
10 - File initialization error
11 - Unicode conversion error
12 - Temporary file creation error
13 - PKCS11 get slot error
14 - PKCS12 decoder start error
15 - error read from import file
16 - pkcs12 decode error
17 - pkcs12 decoder verify error
18 - pkcs12 decoder validate bags error
19 - pkcs12 decoder import bags error
20 - key db conversion version 3 to version 2 error
21 - cert db conversion version 7 to version 5 error
22 - cert and key dbs patch error
23 - get default cert db error
24 - find cert by nickname error
25 - create export context error
26 - PKCS12 add password itegrity error
27 - cert and key Safes creation error
28 - PKCS12 add cert and key error
29 - PKCS12 encode error