Child pages
  • UAPI Functions - GPG::delete_keypair
Skip to end of metadata
Go to start of metadata

Description

This function deletes a GnuPG (GPG) key pair.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/GPG/delete_keypair?key_id=ACFFDB37176B680D


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Delete a GnuPG key.
$poll = $cpanel->uapi(
    'GPG', 'delete_keypair',
    array(
        'key_id' => 'ACFFDB37176B680D'
  )
);


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.
 
#  Delete a GnuPG key.
my $poll = $cpliveapi->uapi(
    'GPG', 'delete_keypair',
    {
        'key_id' => 'ACFFDB37176B680D'
  }
);


Note:

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

 Command Line
uapi --user=username GPG delete_keypair key_id=ACFFDB37176B680D
 Output (JSON)
{
    "apiversion": 3,
    "module": "GPG",
    "func": "delete_keypair",
    "result": {
        "messages": null,
        "status": 1,
        "metadata": {},
        "data": null,
        "warnings": null,
        "errors": null
    }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
key_idstring

Required

The ID of the GPG key that you wish to delete.

Note:

  • The function will delete all keys that match this ID.
    • If you set this parameter to a public key, the function will delete the public key.
    • If you set this parameter to a public and private key pair, the function will delete the public and private keys.
  • To obtain the desired key, call the UAPI GPG::list_secret_keys function.
A valid string.

ACFFDB37176B680D





Returns

This function only returns metadata.