roundcubemail/plugins/enigma/lib/enigma_driver_gnupg.php
public function delete_key($keyid)
    {
        // delete public key
        $result = $this->delete_pubkey($keyid);

        // error handling
        if ($result !== true) {
            $code = $result->getCode();

            // if not found, delete private key
            if ($code == enigma_error::KEYNOTFOUND) {
                $result = $this->delete_privkey($keyid);
            }
            // need to delete private key first
            else if ($code == enigma_error::DELKEY) {
                $result = $this->delete_privkey($keyid);

                if ($result === true) {
                    $result = $this->delete_pubkey($keyid);
                }
            }
        }

        return $result;
    }
public function delete_key($keyid)
    {
        // delete public key
        $result = $this->delete_pubkey($keyid);

        // error handling
        if ($result !== true) {
            $code = $result->getCode();

            // if not found, delete private key
            if ($code == enigma_error::KEYNOTFOUND) {
                $result = $this->delete_privkey($keyid);
            }
            // need to delete private key first
            else if ($code == enigma_error::DELKEY) {
                $result = $this->delete_privkey($keyid);

                if ($result === true) {
                    $result = $this->delete_pubkey($keyid);
                }
            }
        }

        return $result;
    }
public function delete_key ( $ keyid ) { // delete public key $ result = $ this -> delete_pubkey ( $ keyid ) ; // error handling if ( $ result !== true ) { $ code = $ result -> getCode ( ) ; // if not found, delete private key if ( $ code == enigma_error :: KEYNOTFOUND ) { $ result = $ this -> delete_privkey ( $ keyid ) ; } // need to delete private key first else if ( $ code == enigma_error :: DELKEY ) { $ result = $ this -> delete_privkey ( $ keyid ) ; if ( $ result === true ) { $ result = $ this -> delete_pubkey ( $ keyid ) ; } } } return $ result ; }
Key deletion.

@param string Key ID

@return mixed True on success or enigma_error
Key deletion .