LightWave Client
1.4.1 1.4.0 1.3.1 1.2.9 1.2.8 1.2.7 1.2.6 1.2.5 1.2.4
1.4.1 1.4.0 1.3.1 1.2.9 1.2.8 1.2.7 1.2.6 1.2.5 1.2.4

Listing, Exporting and Importing Certificates

This subsection describes using LWCCOM to list, export and import Server Certificates. This can be useful when the Console is not available, and a server certificate must be copied from one filesystem to another, such as when setting up a new instance.

Listing Certificates

The LWCCOM INFO command is used to retrieve information about the Server Certificates in a filesystem. This can be done for both the source and target filesystems.

LWCCOM 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:

LWCCOM 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 LWCCOM export can only be a Server type certificate.

Intermediate certificates cannot be directly exported.

The syntax for the LWCCOM EXPORT CERTIFICATE command is:

LWCCOM 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:

LWCCOM 17-> export certificate cert.dev.example.com, file mycert !, chain, passphrase
Enter PASSPHRASE:
Re-enter PASSPHRASE:
CERTIFICATE 'cert.dev.example.com' exported to $DATA.LWCEXPO.MYCERT,
with chain

The exclamation point after the filename means to overwrite the file if it exists.

The example shows how LWCCOM 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 LWCCOM IMPORT command.

Importing Certificates

The syntax for the LWCCOM IMPORT CERTIFICATE command is:

LWCCOM 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:

LWCCOM 5-> import certificate * !,file mycert, chain, passphrase
Enter PASSPHRASE:
Re-enter PASSPHRASE:
CERTIFICATE 'cert.dev.example.com' imported