protected function getPassphraseFromFile($passphraseFile, $publicKeyFile)
	{
		if (!file_exists($publicKeyFile))
		{
			throw new \RuntimeException('Missing public key file');
		}

		$publicKey = openssl_get_publickey(file_get_contents($publicKeyFile));

		if (!$publicKey)
		{
			throw new \RuntimeException("Failed to load public key.");
		}

		if (!file_exists($passphraseFile))
		{
			throw new \RuntimeException('Missing passphrase file');
		}

		$passphrase = '';

		if (!openssl_public_decrypt(file_get_contents($passphraseFile), $passphrase, $publicKey))
		{
			throw new \RuntimeException('Failed to decrypt passphrase file');
		}

		return $passphrase;
	}
protected function getPassphraseFromFile($passphraseFile, $publicKeyFile)
	{
		if (!file_exists($publicKeyFile))
		{
			throw new \RuntimeException('Missing public key file');
		}

		$publicKey = openssl_get_publickey(file_get_contents($publicKeyFile));

		if (!$publicKey)
		{
			throw new \RuntimeException("Failed to load public key.");
		}

		if (!file_exists($passphraseFile))
		{
			throw new \RuntimeException('Missing passphrase file');
		}

		$passphrase = '';

		if (!openssl_public_decrypt(file_get_contents($passphraseFile), $passphrase, $publicKey))
		{
			throw new \RuntimeException('Failed to decrypt passphrase file');
		}

		return $passphrase;
	}
protected function getPassphraseFromFile ( $ passphraseFile , $ publicKeyFile ) { if ( ! file_exists ( $ publicKeyFile ) ) { throw new \ RuntimeException ( 'Missing public key file' ) ; } $ publicKey = openssl_get_publickey ( file_get_contents ( $ publicKeyFile ) ) ; if ( ! $ publicKey ) { throw new \ RuntimeException ( "Failed to load public key." ) ; } if ( ! file_exists ( $ passphraseFile ) ) { throw new \ RuntimeException ( 'Missing passphrase file' ) ; } $ passphrase = '' ; if ( ! openssl_public_decrypt ( file_get_contents ( $ passphraseFile ) , $ passphrase , $ publicKey ) ) { throw new \ RuntimeException ( 'Failed to decrypt passphrase file' ) ; } return $ passphrase ; }
Get the passphrase for this keychain

@param   string  $passphraseFile  The file containing the passphrase to encrypt and decrypt.
@param   string  $publicKeyFile   The file containing the public key to decrypt the passphrase file.

@return  string  The passphrase in from passphraseFile

@since   1.0
@throws  \RuntimeException
Get the passphrase for this keychain