public function extractPublicKeyToFile($file, $private, $passphrase = null)
    {
        $public = $this->extractPublicKey($private, $passphrase);

        if (false === @ file_put_contents($file, $public)) {
            $error = error_get_last();

            throw new RuntimeException(sprintf(
                'The public key file "%s" could not be written: %s',
                $file,
                $error['message']
            ));
        }
    }
public function extractPublicKeyToFile($file, $private, $passphrase = null)
    {
        $public = $this->extractPublicKey($private, $passphrase);

        if (false === @ file_put_contents($file, $public)) {
            $error = error_get_last();

            throw new RuntimeException(sprintf(
                'The public key file "%s" could not be written: %s',
                $file,
                $error['message']
            ));
        }
    }
public function extractPublicKeyToFile ( $ file , $ private , $ passphrase = null ) { $ public = $ this -> extractPublicKey ( $ private , $ passphrase ) ; if ( false === @ file_put_contents ( $ file , $ public ) ) { $ error = error_get_last ( ) ; throw new RuntimeException ( sprintf ( 'The public key file "%s" could not be written: %s' , $ file , $ error [ 'message' ] ) ) ; } }
Extracts the public key and saves it to a file.

@param string      $file       The file path.
@param string      $private    The private key.
@param null|string $passphrase The passphrase.

@throws RuntimeException If the file could not be written.

@api
Extracts the public key and saves it to a file .