- Created by Documentation, last modified on Apr 09, 2018
cPanel Tags
(deprecated)
Bandwidth:: displaybwheader
Bandwidth:: displaybw
Bandwidth:: displayday
Bandwidth:: displaymainbwheader
BoxTrapper:: changestatus
BoxTrapper:: cleancfgfilelist
BoxTrapper:: editmsg
BoxTrapper:: fetchcfgfile
BoxTrapper:: getboxconfdir
BoxTrapper:: listmsgs
BoxTrapper:: logcontrols
BoxTrapper:: messageaction
BoxTrapper:: multimessageaction
BoxTrapper:: resetmsg
BoxTrapper:: savecfgfile
BoxTrapper:: saveconf
BoxTrapper:: showautowhitelist
BoxTrapper:: showemails
BoxTrapper:: showfromname
BoxTrapper:: showlog
BoxTrapper:: showmessage
BoxTrapper:: showqueue
BoxTrapper:: showqueuesearch
BoxTrapper:: showqueuetime
BoxTrapper:: status
BoxTrapper:: statusbutton
Branding:: file
Branding:: image
Branding:: killimg
Branding:: setbrandingpkg
Branding:: setmyacctspkg
Branding:: setupdirs
Branding:: tempsetbrandingpkg
Chkservd:: geteximport
Chkservd:: geteximport_ssl
ClamScanner:: bars
cPAddons:: mainpg
Cron:: crontab_perms
CustInfo:: getemail
DiskUsage:: showmanager
Email:: addautoresponder
Email:: adddforward
Email:: addfilter
Email:: addlist
Email:: addmx
Email:: addpop
Email:: addspam
Email:: addspambox
Email:: addspamfilter
Email:: changemx
Email:: checkfastmail
Email:: checkpipefwd
Email:: clearspambox
Email:: delautoresponder
Email:: deldforward
Email:: delfilter
Email:: dellist
Email:: delmx
Email:: delpop
Email:: delspam
Email:: delspambox
Email:: disable_spam_autodelete
Email:: editquota
Email:: enable_spam_autodelete
Email:: getaging
Email:: getarsbody
Email:: getarscharset
Email:: getarsfrom
Email:: getarshtml
Email:: getarsinterval
Email:: getarsstart
Email:: getarsstop
Email:: getarssubject
Email:: getmailserver
Email:: getmailserveruser
Email:: getpopquota
Email:: has_spam_as_acl
Email:: has_spam_autodelete
Email:: listmaildomains
Email:: listmaildomainsopt
Email:: listmaildomainsoptndef
Email:: mainacctdiskused
Email:: passwdlist
Email:: passwdpop
Email:: setmxaccept
Email:: spamboxstatus
Email:: spamstatus
Email:: tracefilter
Fileman:: changeperm
Fileman:: delfile
Fileman:: dofileop
Fileman:: emptytrash
Fileman:: extractfile
Fileman:: fileimg
Fileman:: fmmkdir
Fileman:: fmmkfile
Fileman:: fmpushfile
Fileman:: fmrename
Fileman:: fmsavefile
Fileman:: fmsavehtmlfile
Fileman:: fullbackup
Fileman:: getfile
Fileman:: htmleditor
Fileman:: killdir
Fileman:: listfiles
Fileman:: listfullbackups
Fileman:: listtemplates
Fileman:: restoreaf
Fileman:: restoredb
Fileman:: restorefile
Fileman:: restorefiles
Fileman:: savehtmlfile
Fileman:: showperm
Fileman:: uploadfiles
Fileman:: viewfile
Ftp:: addftp
Ftp:: delftp
Ftp:: ftpquota
Ftp:: ftpservername
Ftp:: ftpstatslogin
Ftp:: get_anonftp
Ftp:: get_anonftpin
Ftp:: get_welcomemsg
Ftp:: getftpquota
Ftp:: kill_ftp_session
Ftp:: listftpstatsurl
Ftp:: passwdftp
Ftp:: set_anonftp
Ftp:: set_anonftpin
Ftp:: set_welcomemsg
Htaccess:: checkprotected
Htaccess:: del_user
Htaccess:: getindex
Htaccess:: htdirls
Htaccess:: number_of_users
Htaccess:: phpselectable
Htaccess:: resname
Htaccess:: set_pass
Htaccess:: set_protect
Htaccess:: setindex
Htaccess:: setphpreference
Htaccess:: showusers
ImageManager:: convert
ImageManager:: dimensions
ImageManager:: hdimension
ImageManager:: scale
ImageManager:: thumbnail
ImageManager:: wdimension
LastLogin:: lastlogin
LeechProtect:: disable
LeechProtect:: enable
LeechProtect:: setup
LeechProtect:: showpasswdfile
LeechProtect:: status
MagicRevision:: uri
Mime:: add_handler
Mime:: add_hotlink
Mime:: add_mime
Mime:: add_redirect
Mime:: del_handler
Mime:: del_hotlink
Mime:: del_mime
Mime:: del_redirect
Mime:: linkallownull
Mime:: linkenable
Mime:: linkexts
Mime:: linkrurl
Mime:: linkurls
Mysql:: adddb
Mysql:: addhost
Mysql:: adduser
Mysql:: adduserdb
Mysql:: checkdb
Mysql:: deldb
Mysql:: delhost
Mysql:: deluser
Mysql:: deluserdb
Mysql:: gethost
Mysql:: initcache
Mysql:: listdbs
Mysql:: listdbsopt
Mysql:: listusers
Mysql:: listusersopt
Mysql:: number_of_dbs
Mysql:: number_of_users
Mysql:: repairdb
Mysql:: routines
Mysql:: updateprivs
News:: displaynews
NVData:: set
Postgres:: adddb
Postgres:: adduser
Postgres:: adduserdb
Postgres:: deldb
Postgres:: deluser
Postgres:: deluserdb
Postgres:: initcache
Postgres:: listdbsopt
Postgres:: listusersopt
Postgres:: number_of_dbs
Postgres:: number_of_users
ProxyUtils:: proxyaddress
Resellers:: accountlistopt
Resellers:: themelistopt
Serverinfo:: servicestatus
SetLang:: listlangsopt
SetLang:: setlang
SpamAssassin:: config
SpamAssassin:: saveconfig
SSH:: getport
SSL:: delete
SSL:: deletecrt
SSL:: deletecsr
SSL:: deletekey
SSL:: gencrt
SSL:: gencsr
SSL:: genkey
SSL:: getcabundle
SSL:: getcnname
SSL:: install
SSL:: installedhost
SSL:: listkeysopt
SSL:: showcrt
SSL:: showcsr
SSL:: showkey
SSL:: sslsharedstatus
SSL:: uploadcrt
SSL:: uploadkey
StatManager:: doForm
StatManager:: updateUserConfig
Stats:: analoglist
Stats:: awstats
Stats:: bwbar
Stats:: errlog
Stats:: lastvisitors
Stats:: showbandwidth
Stats:: webalizer
Stats:: webalizerftp
SubDomain:: addsubdomain
SubDomain:: cplistsubdomains
SubDomain:: disablesubrd
SubDomain:: listsubdomainsop
SubDomain:: setsuburl
Description
This function generates a GnuPG key. The system saves the key in the user's /home/.gnupg
directory.
Warning:
cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.
Examples
$cpanel = new CPANEL(); // Connect to cPanel - only do this once. $generate_key = $cpanel->api1('Gpg', 'genkey', array('Helena', 'But what if it was the chicken?', 'user@example.com', '1y', '2048', '12345luggage') ); // Call the function.
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once. my $generate_key = $cpliveapi->api1('Gpg', 'genkey', ['Helena', 'But what if it was the chicken?', 'user@example.com', '1y', '2048', '12345luggage'] ); # Call the function.
<cpanel Module="Gpg::genkey($FORM('name','comment','email','expire','keysize','passphrase'))">
cpapi1 --user=username Gpg genkey Helena "But what if it was the chicken?" user@example.com 1y 2048 12345luggage
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 1 documentation or run the
whmapi1 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi1
command:/usr/local/cpanel/bin/whmapi1
1
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
name | string | Required The person for whom to generate the key. | Any string that contains at least five characters. | Helena |
comment | string | A comment about the key. | Any string. | But what if it was the chicken? |
email | string | Required The email address to encode. | A valid email address. | user@example.com |
expire | string | The desired amount of time between the key's creation (when this function runs) and its expiration. |
Note: Replace | 1y |
keysize | integer | The new key's size, in bytes. Note: Large keys require more time to generate. |
| 2048 |
passphrase | string | The key's password. | A secure password. | 12345luggage |
Returns
1
— The function succeeded.0
— The function failed.
Function information
Module:
Gpg
API Version:
Available in:
cPanel 11+
Methods:
GET, POST
Required Parameters:
name
, email
Return Formats:
boolean
About this module
The Gpg
module manages GnuPG keys.
Note:
This module requires access to the gpg feature, and is not available in demo mode.
About cPanel API 1
Warning:
cPanel API 1 is deprecated. We strongly recommend that you use cPanel API 2 or UAPI instead.
Notes:
- These functions may require a feature list. To view the available feature lists on a cPanel server, view WHM's Feature Manager interface.
- Unless you call this API via the WHM API, you must use the appropriate cPanel ports (
2082
or2083
). You can also call some functions via cPanel's Webmail ports (2095
or2096
).
Find a function
Related functions
-
Page:cPanel API 1 Functions - Gpg::genkey — This function generates a GnuPG key.
-
Page:cPanel API 1 Functions - Gpg::exportsecretkey — This function returns a private GnuPG key.
-
Page:cPanel API 1 Functions - Gpg::importkeys — This function imports a GnuPG key.
-
Page:cPanel API 1 Functions - Gpg::exportkey — This function returns a public GnuPG key.
-
Page:cPanel API 1 Functions - Gpg::deletekey — This function deletes a GnuPG key.