Description
This function retrieves a certificate.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Note:
You must include one of the following parameters:
Parameter |
Type |
Description |
Possible values |
Example |
id |
string |
The certificate's ID. |
A valid string. |
example_com_c69ce_37ff5_1397169490_169c717cb2c260281df792788accf041 |
friendly_name |
string |
The certificate's friendly name. |
A valid string. |
TestCert |
Returns
Return |
Type |
Description |
Possible values |
Example |
cert |
string |
The contents of the certificate. |
A valid certificate file in Base64 PEM format. |
|
text |
string |
The parsed information from the OpenSSL command-line tool. |
A valid string. |
|
details |
hash |
A hash of the certificate's details. |
This hash includes theis_self_signed, modulus,notbefore, notafter, domains, andkey_algorithm,signature_algorithm, andvalidation_type returns and thesubject and issuer hashes. |
|
is_self_signed |
Boolean |
Whether the certificate is self-signed. The functionreturns this value in the detailshash. |
|
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 detailshash. |
|
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 detailshash. |
A valid OID hash algorithm name. |
sha256WithRSAEncryption |
subject |
hash |
A hash of the certificate's ownership details. The functionreturns this hash in the detailshash. |
This hash includes the commonName,stateOrProvinceName,organizationName, emailAddress,countryName, and localityNamereturns. |
|
commonName |
string |
The certificate's Common Name or Distinguished Name. The functionreturns this value in the subjecthash. |
A valid domain name. |
example.com |
stateOrProvinceName |
string |
The certificate's state or province name. The functionreturns this value in the subjecthash. |
A valid string. |
Texas |
organizationName |
string |
The certificate's organization name. The functionreturns this value in the subjecthash. |
A valid string. |
Organization |
emailAddress |
string |
The certificate's email address. The functionreturns this value in the subjecthash. |
A valid email address. |
username@example.com |
countryName |
string |
The certificate's country. The function returns this value in the subjecthash. |
A valid two-letter ISO-3166 country code. |
US |
localityName |
string |
The certificate's locality or city. The functionreturns this value in the subjecthash. |
A valid string. |
Houston |
modulus |
string |
The certificate's modulus. The functionreturns this value in the detailshash. |
A valid string. |
|
issuer |
hash |
A hash of the issuer's details. The functionreturns this value in the detailshash. |
This hash includes the commonName,stateOrProvinceName,organizationName, emailAddress,countryName, and localityNamereturns. |
|
commonName |
string |
The issuer's Common Name or Distinguished Name. The functionreturns this value in the issuerhash. |
A valid domain name. |
example.com |
stateOrProvinceName |
string |
The issuer's state or province name. The functionreturns this value in the issuerhash. |
A valid string. |
Texas |
organizationName |
string |
The issuer's organization name. The functionreturns this value in the issuerhash. |
A valid string. |
Organization |
emailAddress |
string |
The issuer's email address. The functionreturns this value in the issuerhash. |
A valid email address. |
username@example.com |
countryName |
string |
The certificate's country. The functionreturns this value in the issuerhash. |
A valid two-letter ISO-3166 country code. |
US |
localityName |
string |
The issuer's locality or city. The functionreturns this value in the issuerhash. |
A valid string. |
Houston |
not_before |
integer |
The certificate's start time. The functionreturns this value in the detailshash. |
A date in Unix time format. |
1365633490 |
not_after |
integer |
The certificate's expiration time. The functionreturns this value in the detailshash. |
A date in Unix time format. |
1397169490 |
domains |
string |
The certificate's domains or list of domains. The functionreturns this value in the detailshash. |
A valid domain or list of domains. |
example.com |
key_algorithm |
string |
The certificate's method of encryption. The functionreturns this value in the detailshash. |
A valid string. |
rsaEncryption |
id |
string |
The certificate's ID. |
A valid string. |
|
friendly_name |
string |
The certificate's friendly name. |
A valid string. |
TestCert |