Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function lists the server's domains with installed SSL certificates.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-apijson-api/listcrts
 XML API
https://hostname.example.com:2087/cpsess##########/xml-apijson-api/listcrts
 Command Line
whmapi0 listcrts

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "crt" : [
      {
         "domain" : "example.com",
         "domain_owners" : [
            null
         ],
         "domains" : [
            "example.com"
         ],
         "friendly_name" : "example.crt",
         "id" : "example_com_fb75e_d75f3_1423004591_c86613e85f653da6231c23de0507657f",
         "is_self_signed" : 1,
         "validation_type":"dv",
         "signature_algorithm":"sha256WithRSAEncryption",
         "issuer.organizationName" : "example.com",
         "modulus_length" : "4096",
         "not_after" : "1423004591",
         "registered" : 0
      },
      {
         "domain" : "subdomain.example.com",
         "domain_owners" : [
            null
         ],
         "domains" : [
            "subdomain.naptastic.com"
         ],
         "friendly_name" : "subdomain.example.com.crt",
         "id" : "subdomain_example_com_d742d_8231f_1422845416_a9f3d21630e7b3b4a4c6d7a716cbbe76",
         "is_self_signed" : 1,
         "validation_type":"dv",
         "signature_algorithm":"sha256WithRSAEncryption",
         "issuer.organizationName" : null,
         "modulus_length" : "2048",
         "not_after" : "1422845416",
         "registered" : 0
      },
      {
         "domain" : "example2.com",
         "domain_owners" : [
            "example2"
         ],
         "domains" : [
            "example2.com"
         ],
         "friendly_name" : "example2.com",
         "id" : "example2_com_df292_bc005_1434822109_51164bcda5dc53d22b13214a30f32409",
         "is_self_signed" : 1,
         "validation_type":"dv",
         "signature_algorithm":"sha256WithRSAEncryption",
         "issuer.organizationName" : "Example2",
         "modulus_length" : "2048",
         "not_after" : "1434822109",
         "registered" : 1
      }
   ]
}
 Output (XML)
<listcrts>
    <crt>
        <id>
example_com_fb75e_d75f3_1423004591_c86613e85f653da6231c23de0507657f
</id>
        <domain>example.com</domain>
        <domain_owners />
        <domains>example.com</domains>
        <friendly_name>example.crt</friendly_name>
        <is_self_signed>1</is_self_signed>
        <signature_algorithm>sha256WithRSAEncryption</signature_algorithm>
        <validation_type>dv</validation_type>
        <issuer.organizationName>example.com</issuer.organizationName>
        <modulus_length>4096</modulus_length>
        <not_after>1423004591</not_after>
        <registered>0</registered>
    </crt>
    <crt>
        <id>
subdomain_example_com_d742d_8231f_1422845416_a9f3d21630e7b3b4a4c6d7a716cbbe76
</id>
        <domain>subdomain.example.com</domain>
        <domain_owners />
        <domains>subdomain.example.com</domains>
        <friendly_name>subdomain.example.com.crt</friendly_name>
        <is_self_signed>1</is_self_signed>
        <signature_algorithm>sha256WithRSAEncryption</signature_algorithm>
        <validation_type>dv</validation_type>
        <issuer.organizationName />
        <modulus_length>2048</modulus_length>
        <not_after>1422845416</not_after>
        <registered>0</registered>
    </crt>
    <crt>
        <id>
example2_com_df292_bc005_1434822109_51164bcda5dc53d22b13214a30f32409
</id>
        <domain>example2.com</domain>
        <domain_owners>bacube</domain_owners>
        <domains>example2.com</domains>
        <friendly_name>example2.com</friendly_name>
        <is_self_signed>1</is_self_signed>
        <signature_algorithm>sha256WithRSAEncryption</signature_algorithm>
        <validation_type>dv</validation_type>
        <issuer.organizationName>Example2</issuer.organizationName>
        <modulus_length>2048</modulus_length>
        <not_after>1434822109</not_after>
        <registered>1</registered>
    </crt>
</listcrts>

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample

crt

array of hashes

An array of hashes of each certificate's information.

This hash includes the domain, is_self_signed, registered, issuer.organizationName, modulus_lengthnot_afterdomains, domain_owners, idsignature_algorithm, validation_type, and friendly_name returns.
 

domain

string

The certificate's primary domain.

The function returns this value in the crt hash.

A valid domain name.
example.com

is_self_signed

Boolean

Whether the certificate is self-signed.

The function returns this value in the crt hash.

  • 1 — Self-signed.
  • 0Not self-signed.
 1

validation_type

string

The certificate's validation type.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the crt hash.

  • ev — Extended Validation.
  • ov — Organization Validation.
  • dv — Domain Validation.
  • undef — The system could not parse and determine the certificate's validation type.
dv

signature_algorithm


 
string

The signature algorithm of the certificate.

Note:

We introduced this return in cPanel & WHM version 56.

The function returns this value in the crt hash.

A valid OID hash algorithm name.
sha256WithRSAEncryption

registered

BooleanWhether the certificate is registered.

The function returns this value in the crt hash.

  • 1 — Registered.
  • 0Not registered
 1

issuer.organizationName

stringThe organization name of the certificate's issuer.

The function returns this value in the crt hash.

A valid string.Acme, Inc.

modulus_length

integerThe cerficicate'smoduluslength.

The function returns this value in the crt hash.

A positive integer that measures the length in bits.2048

not_after

integerWhen the certificate expires.

The function returns this value in the crt hash.

A date in Unix time format.

1400343187

domains

arrayThe domain or domains that the certificate covers.

The function returns this value in the crt hash.

An array of valid domains.example.com

domain_owners

arrayThe owners of the domain or domains that the certificate covers.

The function returns this value in the crt hash.

An array of valid usernames.
example

id

stringThe certificate's ID.

The function returns this value in the crt hash.

A valid string.
 Click to view...
 example._com_d13b4_362b9_1400343187_b05e5c3e443dda9a8869c4cf7457829e

friendly_name

stringThe certificate's friendly name.

The function returns this value in the crt hash.

A valid string.
TestCertificate