roundcubemail/plugins/enigma/lib/enigma_driver_gnupg.php
public function import($content, $isfile = false, $passwords = array())
    {
        try {
            // GnuPG 2.1 requires secret key passphrases on import
            foreach ($passwords as $keyid => $pass) {
                $this->gpg->addPassphrase($keyid, $pass);
            }

            if ($isfile)
                return $this->gpg->importKeyFile($content);
            else
                return $this->gpg->importKey($content);
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function import($content, $isfile = false, $passwords = array())
    {
        try {
            // GnuPG 2.1 requires secret key passphrases on import
            foreach ($passwords as $keyid => $pass) {
                $this->gpg->addPassphrase($keyid, $pass);
            }

            if ($isfile)
                return $this->gpg->importKeyFile($content);
            else
                return $this->gpg->importKey($content);
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function import ( $ content , $ isfile = false , $ passwords = array ( ) ) { try { // GnuPG 2.1 requires secret key passphrases on import foreach ( $ passwords as $ keyid => $ pass ) { $ this -> gpg -> addPassphrase ( $ keyid , $ pass ) ; } if ( $ isfile ) return $ this -> gpg -> importKeyFile ( $ content ) ; else return $ this -> gpg -> importKey ( $ content ) ; } catch ( Exception $ e ) { return $ this -> get_error_from_exception ( $ e ) ; } }
Key file import.

@param string File name or file content
@param bolean True if first argument is a filename
@param array  Optional key => password map

@return mixed Import status array or enigma_error
Key file import .