cPanel/GPG
cPanel module

GPG

7 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="GPG", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

delete_keypair GET#

Delete GnuPG key pair

This function deletes a GnuPG (GPG) key pair.

key_idstringRequired
The ID of the GPG key that you wish to delete. Note: The function will delete all keys that match this ID. If you set this parameter to a public key, the function will delete the public key. If you set this parameter to a public and private key pair, the function will delete the public and private keys. To obtain the desired key, call the UAPI GPG::list_secret_keys function.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

Payload varies by call.

export_public_key GET#

Export GnuPG public key

This function exports a GnuPG (GPG) public key.

key_idstringRequired
The ID of the GPG key.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

key_datastring
The GPG public key's contents.

export_secret_key GET#

Export GnuPG secret key

This function exports a GnuPG (GPG) secret key.

key_idstringRequired
The ID of the GPG secret key that you wish to retrieve.
passphrasestringOptional
The passphrase of the GPG secret key that you wish to retrieve.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

key_datastring
The GPG key's contents.

generate_key GET#

Create GnuPG key

This function generates a GnuPG (GPG) key. The system saves the key in the user's .gnupg directory.

Note:

This function uses the system's entropy) to generate the key. Systems with low entropy levels may cause long generation times or timeouts.

emailstringRequired
The user's email address.
namestringRequired
The name of the user for whom to generate the key.
passphrasestringRequired
The key's password.
commentstringOptional
A comment about the key.
expirestringOptional
The desired expiration date of the key as a timestamp in Unix time format. Note: This will default to one year from the current date.
keysizeintegerOptional
The new key's size, in bytes. Note: Large keys require more time to generate.
no_expireintegerOptional
Whether to generate the key without an expiration date. 0 - The key will expire. 1 - The key will not expire.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

Payload varies by call.

import_key GET#

Import GnuPG key

This function imports a GnuPG (GPG) key.

key_datastringRequired
The key to import. Note: You must URI-encode this value.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

key_idstring
The key's ID.

list_public_keys GET#

Return current user's GnuPG public keys

This function lists the GnuPG (GPG) public keys for the currently-authenticated account.

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

algorithmstring
The key's algorithm. RSA DSA
One of: RSA DSA
bitsinteger
The length of the key, in bits.
One of: 1024 2048 3072 4096
createdstring
The creation time for the key, in Unix time format.
expiresstring
When the key will expire, in Unix time format. Note: If the key does not expire, this will be an empty string.
idstring
The key's ID.
typestring
The type of key. Note: This will always be "pub" because we are listing public keys.
One of: pub
user_idstring
The user ID of the key which consists of the following space-separated values: The username. The key's comment in parentheses. * The key's email address in angle brackets (<>).

list_secret_keys GET#

Return current user's GnuPG secret keys

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

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

algorithmstring
The key's algorithm. RSA DSA
One of: RSA DSA
bitsinteger
The key's length.
createdinteger
When the function created the key.
expiresinteger
When the key will expire.
idstring
The key's ID.
typestring
The type of key. * sec is the only possible value.
One of: sec
user_idstring
The user ID of the key. The system returns this value as a space-separated string with the following values: The username. A comment in parentheses. * The key's email address in angle brackets (<>).