Child pages
  • cPanel API 1 Functions - Gpg::exportsecretkey
Skip to end of metadata
Go to start of metadata

 

Description

This function returns a private GnuPG key.

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 


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$export_shh_key = $cpanel->api1('Gpg', 'exportsecretkey', array('75442F4C') ); // Call the function.


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.
my $export_shh_key = $cpliveapi->api1('Gpg', 'exportsecretkey', ['75442F4C'] ); # Call the function.


Note:

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

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Gpg::exportkey($FORM('key'))">
 Command Line
cpapi1 --user=username Gpg exportsecretkey 75442F4C


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

 Output (string)
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
lQHhBFQbVRwRBADD5zKtI27LponwS2aM5dt3HJQHkcg2TOUShSIKZfHUpCPFDOTP
ei/30910wIPtknukevqujoXMwVFlGk6bIc1MfhLC6G3DeT8Soit9MRBdTbr0R10P
ggp7gOPlseZidlM+qgh5ksh//vR5F5ZFkYQisTDol+yaBzhHdDa2qQ5OQwCg+Szr
17GVZLVlDC6x2Ieid1gAVFsEAL0XPApKQ9OKsx5XdsN8zJbpQPh8WjL4tT2oxiTZ
7GPNcd4aILOctOs03r5fHYNreizMy8LJYTiPKlqjaodTv7SPTXEml+otZv+dGeM6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HhnYpdjYJnbsJ/Wn3x99ztbq0jHD0Vu
IVNfzGFUAF51V3whvpiudjCtaARjoINhTVc5Z8AHwKwOrQ8w9xB8VTYE9l8gOWAn
zfJE0zA/+yqzJXMx3yRsOjCNkwvUEEMETXEmRhovx80tvqa4zFL93RgJRiVzWI56
nf60Fv9ld1SLGDq+SMJta+vcvWkpZ2pOyf4DAwJZw21+ux7xu2AgkjEBledA3jjA
LZO1NN+IqeH6Bqwn1HrM3WgVg2YSPZB/rgCtgwwFCgNdmnQlhQoQch4ByB8wwi/L
Hit9DTWgcxHlTE6LUqaliE8EGBECAA8FAlQbVS4CGwwFCQHhM4AACgkQT/0i8MnR
zimuHgCeOYqkElHuVE73dqzZdG1b6E7AvFIAoIdjO8yRV8HJWOAMy/yNpUsiAlsn
=C1Qn
-----END PGP PRIVATE KEY BLOCK-----

   

Parameters

ParameterTypeDescriptionPossible valuesExample
keystring

Required

The key's identifier.

The identifier for a key on the server.

Note:

This value should closely resemble the example value. 

75442F4C

Returns

This function returns the private key.