public function load($public_key = '', $private_key = '')
    {
        // If the private key is a file name then convert it to
        // the contents of the file (which should be an RSA private
        // key in PEM format)
        if (file_exists($private_key)) {
            $this->private_key_text = file_get_contents($private_key);
        } elseif (! empty($private_key)) {
            $this->private_key_text = $private_key;
        }

        // If the public key is a file name then convert it to
        // the contents of the file (which should be an RSA public
        // key in PEM format)
        if (file_exists($public_key)) {
            $this->public_key_text = file_get_contents($public_key);
        } elseif (! empty($public_key)) {
            $this->public_key_text = $public_key;
        }

        return $this;
    }
public function load($public_key = '', $private_key = '')
    {
        // If the private key is a file name then convert it to
        // the contents of the file (which should be an RSA private
        // key in PEM format)
        if (file_exists($private_key)) {
            $this->private_key_text = file_get_contents($private_key);
        } elseif (! empty($private_key)) {
            $this->private_key_text = $private_key;
        }

        // If the public key is a file name then convert it to
        // the contents of the file (which should be an RSA public
        // key in PEM format)
        if (file_exists($public_key)) {
            $this->public_key_text = file_get_contents($public_key);
        } elseif (! empty($public_key)) {
            $this->public_key_text = $public_key;
        }

        return $this;
    }
public function load ( $ public_key = '' , $ private_key = '' ) { // If the private key is a file name then convert it to // the contents of the file (which should be an RSA private // key in PEM format) if ( file_exists ( $ private_key ) ) { $ this -> private_key_text = file_get_contents ( $ private_key ) ; } elseif ( ! empty ( $ private_key ) ) { $ this -> private_key_text = $ private_key ; } // If the public key is a file name then convert it to // the contents of the file (which should be an RSA public // key in PEM format) if ( file_exists ( $ public_key ) ) { $ this -> public_key_text = file_get_contents ( $ public_key ) ; } elseif ( ! empty ( $ public_key ) ) { $ this -> public_key_text = $ public_key ; } return $ this ; }
Load the keys from files or strings.

It's not required to provide both the private and the public
key. The key will be initialised with whichever or both keys
are provided.

@param string $public_key  file name or contents
@param string $private_key file name or contents

@return KeyPair provides a fluent interface
Load the keys from files or strings .