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

 

Description

This function deletes 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.
$delete_public_key = $cpanel->api1('Gpg', 'deletekey', array('75442F4C','1') ); // 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 $delete_public_key = $cpliveapi->api1('Gpg', 'deletekey', ['75442F4C','1'] ); # 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::deletekey($FORM('key','secret'))">
 Command Line
cpapi1 --user=username Gpg deletekey 75442F4C 1


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
idstring

Required

The key's identifier.

The identifier for a key on the server.

Note:

This value should closely resemble the example value. 

75442F4C
secretBoolean

Required

Whether to delete the private key or the public key.

  • 1 — Delete the private key.
  • 0 — Delete the public key.

Important:

You must delete the private key before you delete the public key. 

1

Returns

This function does not return output.