Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

Gpg Module Documentation

The Gpg module allows users to create and manage GnuPG keys.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

Gpg::genkey

API Version: 1 - Click here for documentation
Syntax: Gpg::genkey( name, comment, email, expire, keysize, passphrase )
Description: Generate a GnuPGP key. The key will be saved in your .gnupg directory inside of your home directory. You must have access to the 'pgp' feature to use this function. This feature is not available in demo mode.
Parameters:  
  name (string)
  The name of the person for whom you are generating the key. This value must be at least 5 characters.
  comment (string (optional))
  A comment about the new key.
  email (string)
  The email address you wish to encode.
  expire (string (optional))
  Expiration time (from present) for the key. Values must start with one or more digits, followed by one of the following letters: y (year), m (month), w (week), or d (day). (e.g. 1y sets the expiration date for 1 year from the present).
  keysize (integer (optional))
  The key size of the new key. Acceptable values include 1024, 2048, 3072, or 4096. Note: Larger key sizes take longer to generate.
  passphrase (string (optional))
  The password to associate with the new key.
Returns:  
 
Output's '1' if successful.

Gpg::exportsecretkey

API Version: 1 - Click here for documentation
Syntax: Gpg::exportsecretkey( key )
Description: Export (print) a private GPG key. This function requires access to the 'gpg' feature. This function is not available in demo mode.
Parameters:  
  key (string)
  The identifier corresponding to the key to be printed. This value should resemble the following: 75442F4C.
Returns:  
 
The output will contain the selected key.

Gpg::importkeys

API Version: 1 - Click here for documentation
Syntax: Gpg::importkeys( keydata )
Description: Import a GPG key. This function requires access to the 'gpg' feature. This function is not available in demo mode.
Parameters:  
  keydata (string)
  The key data to be imported.
Returns:  
 
This function does not produce output if it is successful.

Gpg::exportkey

API Version: 1 - Click here for documentation
Syntax: Gpg::exportkey( key )
Description: Export (print) a public GPG key. This function requires access to the 'gpg' feature. This function is not available in demo mode.
Parameters:  
  key (string)
  The identifier of the key to be printed. This value should resemble the following: 75442F4C.
Returns:  
 
The output will contain the contents of the key.

Gpg::deletekey

API Version: 1 - Click here for documentation
Syntax: Gpg::deletekey( id, secret )
Description: Delete a GPG key. This function requires access to the 'gpg' feature. This function is not available in demo mode.
Parameters:  
  id (string)
  The ID of the key to delete. This value should resemble something like D2AF7601.
  secret (boolean)
  This value specifies whether the private key is being deleted. The private key must be deleted before the public key. Failing to delete the private key first will cause an error.
Returns:  
 
This function does not produce any output if it is successful.

Topic revision: r2 - 27 Mar 2012 - 18:28:59 - Main.JenniferDoubrava