v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
GPG
Signing and Encryption (GnuPG Keys)

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.

get/GPG/generate_key

Query parameters

emailstring email required
Example:user@example.com

The user's email address.

namestring username required
Example:username

The name of the user for whom to generate the key.

passphrasestring required
Example:123456luggage

The key's password.

commentstring
Example:Username's Key

A comment about the key.

expirestring
Example:1560363242

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.

keysize1024 | 2048 | 3072 | 4096
Example:2048

The new key's size, in bytes.

Note:

Large keys require more time to generate.

no_expire0 | 1

Whether to generate the key without an expiration date.

  • 0 - The key will expire.
  • 1 - The key will not expire.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "generate_key",
  "module": "GPG",
  "result": {
    "status": 1
  }
}