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

 

Description

This function imports a 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', 'importkeys', array('lQHhBFQbVRwRBADD5zKtI27LponwS2aM5dt3HJQHkcg2TOUShSIKZfHUpCPFDOTPei/30910wIPtknukevqujoXMwVFlGk6bIc1MfhLC6G3DeT8Soit9MRBdTbr0R10Pggp7gOPlseZidlM+qgh5ksh//vR5F5ZFkYQisTDol+yaBzhHdDa2qQ5OQwCg+Szr17GVZLVlDC6x2Ieid1gAVFsEAL0XPApKQ9OKsx5XdsN8zJbpQPh8WjL4tT2oxiTZ7GPNcd4aILOctOs03r5fHYNreizMy8LJYTiPKlqjaodTv7SPTXEml+otZv+dGeM60g81o8ku/jvxCUSxxUNwBUJpQaycqcaoY3amdfwTMIRmWkRswe5Cv6CVwrlrvv+y9F9EA/9plsdrmLvs7nzcZ4w+vlmkjbMT2rtmwYNxlJKS0os+S2oADRWU3Q78hnnxcDd5sH+NZNc1dZe58zYwVrQNmLrHQOjJnpwDrGjyahh4Gz1VzbK+KlMXeTbYh1h45cqcfNbXdmndXU+W5pjQwk9qq7UkfC2/pNWhcKKlFF96T8286f4DAwJZw21+ux7xu2CmCW/k7w1276Jf42k9i7N2r&y32914bu775Ru+4b4Ga1222rjzy1tV1o272qNLHKaC07Q7SGVsZW5hIChCdXQgd2hhdCBpZiBpdCB3YXMgdGhlIGNoaWNrZW4/KSA8dXNlckBleGFtcGxlLmNvbT6IZgQTEQIAJgUCVBtVHAIbIwUJAeEzgAYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEE/9IvDJ0c4p3jwAoKMLrsTagRZgT25R+YEG06FFfk7WAKDS95HhjeUSjt0+ceYGlm8nPbCy/p0CYwRUG1UuEAgA8qO6+Z8Ra/DThbuoqc/2+aJj3CllJEdgbLQIh1JhU2n3MNQ7Rqvdk8usO6nOiVXWZMMrGuRefjXoYOfShkRsNw5xNJG7ef8ThgAZKfQZecXgFKye/WgjHpxOIeSBzR5aOGIz2rzJCNSIXE61+cnWdJj84ymmx66/PcXfMDxGv3T9jYMvLiobI4BY6cOAb+RD+e6SejHsR3/L41s0UA5NDN5rmXbDTKfAzTG0746N5kynIQj2YemgivY4GlmqvHVhvUoKhPqb9OTjiXbyW1wTiDGn1IgmvgRxiNKU+BrkbfdxzgNSNxHF2UN/zuI3xMTd/lExJBU2QjHKP8vkBTbftwADBQf/aJ7RNir+f3EuebBZYq9ehcLCZzOLGJmI89ZD1kE3iCkT7iCbrxkhUkcMeR2MyUU5IZrNXLW3a2mCdT4LxcERQk7Scw1IANj9iafh6ukdqkBO8TCbwKMHvlLk8egV+lTJIuXEdHlL3mqNrPuxK84ArHhnYpdjYJnbsJ/Wn3x99ztbq0jHD0VuIVNfzGFUAF51V3whvpiudjCtaARjoINhTVc5Z8AHwKwOrQ8w9xB8VTYE9l8gOWAnzfJE0zA/+yqzJXMx3yRsOjCNkwvUEEMETXEmRhovx80tvqa4zFL93RgJRiVzWI56nf60Fv9ld1SLGDq+SMJta+vcvWkpZ2pOyf4DAwJZw21+ux7xu2AgkjEBledA3jjALZO1NN+IqeH6Bqwn1HrM3WgVg2YSPZB/rgCtgwwFCgNdmnQlhQoQch4ByB8wwi/LHit9DTWgcxHlTE6LUqaliE8EGBECAA8FAlQbVS4CGwwFCQHhM4AACgkQT/0i8MnRzimuHgCeOYqkElHuVE73dqzZdG1b6E7AvFIAoIdjO8yRV8HJWOAMy/yNpUsiAlsn=C1Qn') ); // 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', 'importkeys', ['lQHhBFQbVRwRBADD5zKt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0746N5kynIQj2YemgivY4GlmqvHVhvUoKhPqb9OTjiXbyW1wTiDGn1IgmvgRxiNKU+BrkbfdxzgNSNxHF2UN/zuI3xMTd/lExJBU2QjHKP8vkBTbftwADBQf/aJ7RNir+f3EuebBZYq9ehcLCZzOLGJmI89ZD1kE3iCkT7iCbrxkhUkcMeR2MyUU5IZrNXLW3a2mCdT4LxcERQk7Scw1IANj9iafh6ukdqkBO8TCbwKMHvlLk8egV+lTJIuXEdHlL3mqNrPuxK84ArHhnYpdjYJnbsJ/Wn3x99ztbq0jHD0VuIVNfzGFUAF51V3whvpiudjCtaARjoINhTVc5Z8AHwKwOrQ8w9xB8VTYE9l8gOWAnzfJE0zA/+yqzJXMx3yRsOjCNkwvUEEMETXEmRhovx80tvqa4zFL93RgJRiVzWI56nf60Fv9ld1SLGDq+SMJta+vcvWkpZ2pOyf4DAwJZw21+ux7xu2AgkjEBledA3jjALZO1NN+IqeH6Bqwn1HrM3WgVg2YSPZB/rgCtgwwFCgNdmnQlhQoQch4ByB8wwi/LHit9DTWgcxHlTE6LUqaliE8EGBECAA8FAlQbVS4CGwwFCQHhM4AACgkQT/0i8MnRzimuHgCeOYqkElHuVE73dqzZdG1b6E7AvFIAoIdjO8yRV8HJWOAMy/yNpUsiAlsn=C1Qn'] ); # 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::importkeys($FORM('keydata'))">
 Command Line
cpapi1 --user=username Gpg importkeys lQHhBFQbVRwRBADD5zKtI27LponwS2aM5dt3HJQHkcg2TOUShSIKZfHUpCPFDOTPei/30910wIPtknukevqujoXMwVFlGk6bIc1MfhLC6G3DeT8Soit9MRBdTbr0R10Pggp7gOPlseZidlM+qgh5ksh//vR5F5ZFkYQisTDol+yaBzhHdDa2qQ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89ZD1kE3iCkT7iCbrxkhUkcMeR2MyUU5IZrNXLW3a2mCdT4LxcERQk7Scw1IANj9iafh6ukdqkBO8TCbwKMHvlLk8egV+lTJIuXEdHlL3mqNrPuxK84ArHhnYpdjYJnbsJ/Wn3x99ztbq0jHD0VuIVNfzGFUAF51V3whvpiudjCtaARjoINhTVc5Z8AHwKwOrQ8w9xB8VTYE9l8gOWAnzfJE0zA/+yqzJXMx3yRsOjCNkwvUEEMETXEmRhovx80tvqa4zFL93RgJRiVzWI56nf60Fv9ld1SLGDq+SMJta+vcvWkpZ2pOyf4DAwJZw21+ux7xu2AgkjEBledA3jjALZO1NN+IqeH6Bqwn1HrM3WgVg2YSPZB/rgCtgwwFCgNdmnQlhQoQch4ByB8wwi/LHit9DTWgcxHlTE6LUqaliE8EGBECAA8FAlQbVS4CGwwFCQHhM4AACgkQT/0i8MnRzimuHgCeOYqkElHuVE73dqzZdG1b6E7AvFIAoIdjO8yRV8HJWOAMy/yNpUsiAlsn=C1Qn


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. 

 Output (none)

This function does not return output.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
keydatastring

Required

The key to import.

A GnuPG key.

 Click to view...
lQHhBFQbVRwRBADD5zKtI27LponwS2aM5dt3HJQHkcg2TOUShSIKZfHUpCPFDOTPei/30910wIPtknukevqujoXMwVFlGk6bIc1MfhLC6G3DeT8Soit9MRBdTbr0R10Pggp7gOPlseZidlM+qgh5ksh//vR5F5ZFkYQisTDol+yaBzhHdDa2qQ5OQwCg+Szr17GVZLVlDC6x2Ieid1gAVFsEAL0XPApKQ9OKsx5XdsN8zJbpQPh8WjL4tT2oxiTZ7GPNcd4aILOctOs03r5fHYNreizMy8LJYTiPKlqjaodTv7SPTXEml+otZv+dGeM60g81o8ku/jvxCUSxxUNwBUJpQaycqcaoY3amdfwTMIRmWkRswe5Cv6CVwrlrvv+y9F9EA/9plsdrmLvs7nzcZ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