Child pages
  • GPG::list_secret_keys
Skip to end of metadata
Go to start of metadata

Description

This function lists the GPG secret keys for the currently-authenticated account.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/GPG/list_secret_keys


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List GPG secret keys.
$poll = $cpanel->uapi(
    'GPG', 'list_secret_keys',
   )
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  List GPG secret keys.
my $poll = $cpliveapi->uapi(
    'GPG', 'list_secret_keys',
   
  }
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- List GPG secret keys. -->
[% execute('GPG', 'list_secret_keys', {} ) %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username GPG list_secret_keys
 Output (JSON)
{
    "apiversion": 3,
    "module": "GPG",
    "func": "list_secret_keys",
    "result": {
        "messages": null,
        "metadata": {
            "transformed": 1
        },
        "warnings": null,
        "data": [
            {
                "id": "48BEA5A16FCA746E",
                "user_id": "bender (is great) <bender@example.com>",
                "created": "1559238435",
                "type": "sec",
                "algorithm": "DSA",
                "bits": "2048",
                "expires": "1590774435"
            }
        ],
        "errors": null,
        "status": 1
    }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
idstringThe key's ID.A string value.738538C1
user_idstringThe user ID of the key.

A string that consists of the following space-separated values:

  • The username.
  • A comment in parentheses.
  • The key's email address in angle brackets.



bender (is great) <bender@example.com>



createdintegerWhen the function created the key.A valid time, in Unix time format.1559238435
typestringThe type of key.

sec is the only possible value.

sec
algorithmstringThe key's algorithm.
  • RSA
  • DSA
DSA
bitsstringThe key's length.The length of the key, in bits.2048
expiresintegerWhen the key will expire.A valid time, in Unix time format.1590774435