Certificate Viewer utility (viewcert)

Display values within a Public Key Infrastructure (PKI) object, convert the encoding of PKI objects, or encrypt and decrypt private keys.

Syntax
viewcert [ options ] input-file

The input-file must be a DER- or PEM-encoded PKI object.

Option Description
-d DER-encodes the output. This option is only useful with the -o option. It cannot be used with -p. By default, viewcert outputs the PKI object in a readable text format.
-ip input-password Specifies the password needed to decrypt the private key if the input-file contains an encrypted private key.
-o output-file Specifies the file that viewcert should write the output to. By default, viewcert writes the output to the command prompt window where it is running.
-op output-password Specifies the password viewcert should use to encrypt a private key. This option is only useful with -d or -p. By default, private keys are not encrypted.
-p PEM-encodes the output. This option is only useful with the -o option. It cannot be used with -d. By default, viewcert outputs the PKI object in a readable text format.
Remarks

The viewcert utility can be used to view the following types of PKI objects:

Viewcert can also be used to convert between DER and PEM encoding types and to encrypt or decrypt private keys.

The viewcert utility supports RSA and ECC objects. To view ECC objects, you must order a separate license. See Separately licensed components.

See also
Example

The following example allows you to view the sample RSA certificate that is included with SQL Anywhere:

viewcert rsaroot.crt

This example produces the following output:

SQL Anywhere X.509 Certificate Viewer Version 11.0.1.3330

X.509 Certificate
-----------------
Common Name: RSA Root
Organizational Unit: test
Organization:  test
Locality:  test
State/Province:  test
Country Code:  test
Issuer:   RSA Root
Serial Number:  303031
Issued:   Apr 15, 2002  12:53:51
Expires:  Apr 16, 2022  12:53:51
Signature Algorithm: RSA, MD5
Key Type:  RSA
Key Size:  1024 bits
Basic Constraints: Is a certificate authority, path length limit: 10
Key Usage:  Certificate Signing, CRL Signing