roundcubemail/plugins/enigma/lib/enigma_driver_gnupg.php
public function gen_key($data)
    {
        try {
            $debug  = $this->rc->config->get('enigma_debug');
            $keygen = new Crypt_GPG_KeyGenerator(array(
                    'homedir' => $this->homedir,
                    // 'binary'  => '/usr/bin/gpg2',
                    'debug'   => $debug ? array($this, 'debug') : false,
            ));

            $key = $keygen
                ->setExpirationDate(0)
                ->setPassphrase($data['password'])
                ->generateKey($data['user'], $data['email']);

            return $this->parse_key($key);
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function gen_key($data)
    {
        try {
            $debug  = $this->rc->config->get('enigma_debug');
            $keygen = new Crypt_GPG_KeyGenerator(array(
                    'homedir' => $this->homedir,
                    // 'binary'  => '/usr/bin/gpg2',
                    'debug'   => $debug ? array($this, 'debug') : false,
            ));

            $key = $keygen
                ->setExpirationDate(0)
                ->setPassphrase($data['password'])
                ->generateKey($data['user'], $data['email']);

            return $this->parse_key($key);
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
public function gen_key ( $ data ) { try { $ debug = $ this -> rc -> config -> get ( 'enigma_debug' ) ; $ keygen = new Crypt_GPG_KeyGenerator ( array ( 'homedir' => $ this -> homedir , // 'binary'  => '/usr/bin/gpg2', 'debug' => $ debug ? array ( $ this , 'debug' ) : false , ) ) ; $ key = $ keygen -> setExpirationDate ( 0 ) -> setPassphrase ( $ data [ 'password' ] ) -> generateKey ( $ data [ 'user' ] , $ data [ 'email' ] ) ; return $ this -> parse_key ( $ key ) ; } catch ( Exception $ e ) { return $ this -> get_error_from_exception ( $ e ) ; } }
Key pair generation.

@param array Key/User data (user, email, password, size)

@return mixed Key (enigma_key) object or enigma_error
Key pair generation .