roundcubemail/plugins/enigma/lib/enigma_driver_gnupg.php
public function export($keyid, $with_private = false, $passwords = array())
    {
        try {
            $key = $this->gpg->exportPublicKey($keyid, true);

            if ($with_private) {
                // GnuPG 2.1 requires secret key passphrases on export
                foreach ($passwords as $_keyid => $pass) {
                    $this->gpg->addPassphrase($_keyid, $pass);
                }

                $priv = $this->gpg->exportPrivateKey($keyid, true);
                $key .= $priv;
            }

            return $key;
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function export($keyid, $with_private = false, $passwords = array())
    {
        try {
            $key = $this->gpg->exportPublicKey($keyid, true);

            if ($with_private) {
                // GnuPG 2.1 requires secret key passphrases on export
                foreach ($passwords as $_keyid => $pass) {
                    $this->gpg->addPassphrase($_keyid, $pass);
                }

                $priv = $this->gpg->exportPrivateKey($keyid, true);
                $key .= $priv;
            }

            return $key;
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function export ( $ keyid , $ with_private = false , $ passwords = array ( ) ) { try { $ key = $ this -> gpg -> exportPublicKey ( $ keyid , true ) ; if ( $ with_private ) { // GnuPG 2.1 requires secret key passphrases on export foreach ( $ passwords as $ _keyid => $ pass ) { $ this -> gpg -> addPassphrase ( $ _keyid , $ pass ) ; } $ priv = $ this -> gpg -> exportPrivateKey ( $ keyid , true ) ; $ key .= $ priv ; } return $ key ; } catch ( Exception $ e ) { return $ this -> get_error_from_exception ( $ e ) ; } }
Key export.

@param string Key ID
@param bool   Include private key
@param array  Optional key => password map

@return mixed Key content or enigma_error
Key export .