This subsection describes using LWSCOM to list, export and import Certificates. This can be useful when the Console is not available, and server certificates must be copied from one filesystem to another, such as during a migration from QA to production.
Listing Certificates
The LWSCOM INFO command is used to retrieve information about the Certificates in a filesystem. This can be done for both the source and target filesystems.
LWSCOM 11-> help info certificate
INFO CERTIFICATE Command
Displays information about CERTIFICATES in the filesystem.
INFO CERTIFICATE <certificate-spec>
[ , DETAIL ]
<certificate-spec>
The certificate Common Name or '*' to select all certificates.
DETAIL
Causes detailed information to be displayed. The use of this parameter is
object-specific.
For example:
LWSCOM 12-> info certificate *
Common Name Type
---------------------------------------------------------------- ------------
cert.dev.example.com Server
Root QWERTY Intermediate
YNOTU Intermediate
--- 3 CERTIFICATEs
Exporting Certificates
Note: The target of the LWSCOM export can only be a Server type certificate.
Intermediate certificates cannot be directly exported.
The syntax for the LWSCOM EXPORT CERTIFICATE command is:
LWSCOM 15-> help export certificate
EXPORT CERTIFICATE Command
Exports a Server CERTIFICATE to a PKCS12 archive file. Note that currently,
only Server certificates may be exported.
EXPORT CERTIFICATE <certificate-spec>
, FILE <file-spec> [ ! ]
, PASSPHRASE [ <string> ]
[ , CHAIN ]
<certificate-spec>
The Common Name of the certificate to export.
FILE <file-spec> [ ! ]
The file in which to store the exported certificate.
PASSPHRASE [ <string> ]
A passphrase to secure the private key in the output file, if any. If
<string> is omitted, you are prompted for the password in a manner that will
not reveal it.
CHAIN
Indicates whether or not the certificate's intermediate certificate chain
will be exported. If omitted, the chain will NOT be exported.
For example:
LWSCOM 17-> export certificate cert.dev.example.com, file mycert !, chain, passphrase
Enter PASSPHRASE:
Re-enter PASSPHRASE:
CERTIFICATE 'cert.dev.example.com' exported to $DATA.LWSEXPO.MYCERT,
with chain
The exclamation point after the filename means to overwrite the file if it exists.
The example shows how LWSCOM will prompt for a passphrase if not entered on the command-line (the passphrase is not echoed during entry).
The MYCERT file can then be used for a LWSCOM IMPORT command.
Importing Certificates
The syntax for the LWSCOM IMPORT CERTIFICATE command is:
LWSCOM 18-> help import certificate
IMPORT CERTIFICATE Command
Imports a CERTIFICATE from a PKCS12 or PEM archive file.
IMPORT CERTIFICATE <certificate-spec> [ ! ]
, FILE <file-spec>
[ , PASSPHRASE [ <string> ] ]
[ , CHAIN ]
<certificate-spec> [ ! ]
The Common Name of the certificate to import or "*" to import all
certificates in the archive file. Specify [ ! ] to replace an existing
certificate with the same Common Name.
FILE <file-spec>
The certificate archive file.
PASSPHRASE [ <string> ]
A passphrase required to import the private key in the archive file, if any.
If <string> is omitted, you are prompted for the password in a manner that
will not reveal it.
CHAIN
Indicates whether or not the certificate's intermediate certificate chain
will be imported. If omitted, the chain will NOT be imported.
When importing a Certificate, you can use the common name (CN) for a specific certificate (e.g., cert.dev.example.com) or use the “*” (asterisk) to mean “all certificates in the file.”
For example:
LWSCOM 5-> import certificate * !,file mycert, chain, passphrase
Enter PASSPHRASE:
Re-enter PASSPHRASE:
CERTIFICATE 'cert.dev.example.com' imported