public function decrypt( $text, $privateKey ) {
		$this->resetHome();

		$privateKeyId = $this->addKey( $privateKey );
		if ( !$privateKeyId ) {
			return false;
		}

		$cipherFile = $this->homeDir->makeTempFile( 'ciphertext-', $text );
		$clearFile = $this->homeDir->makeTempFile( 'cleartext-' );

		$args = array( '--decrypt', '--output', $clearFile, $cipherFile );
		$output = $this->call( $args, $retval );
		if ( $retval ) {
			$this->logger->warning( 'GPG encrypt call returned error',
				array( 'retval' => $retval, 'output' => $output ) );
			return false;
		}

		$clearText = file_get_contents( $clearFile );
		if ( !$clearText ) {
			$this->logger->warning( 'failed to load cleartext file' );
			return false;
		}

		return $clearText;
	}
public function decrypt( $text, $privateKey ) {
		$this->resetHome();

		$privateKeyId = $this->addKey( $privateKey );
		if ( !$privateKeyId ) {
			return false;
		}

		$cipherFile = $this->homeDir->makeTempFile( 'ciphertext-', $text );
		$clearFile = $this->homeDir->makeTempFile( 'cleartext-' );

		$args = array( '--decrypt', '--output', $clearFile, $cipherFile );
		$output = $this->call( $args, $retval );
		if ( $retval ) {
			$this->logger->warning( 'GPG encrypt call returned error',
				array( 'retval' => $retval, 'output' => $output ) );
			return false;
		}

		$clearText = file_get_contents( $clearFile );
		if ( !$clearText ) {
			$this->logger->warning( 'failed to load cleartext file' );
			return false;
		}

		return $clearText;
	}
public function decrypt ( $ text , $ privateKey ) { $ this -> resetHome ( ) ; $ privateKeyId = $ this -> addKey ( $ privateKey ) ; if ( ! $ privateKeyId ) { return false ; } $ cipherFile = $ this -> homeDir -> makeTempFile ( 'ciphertext-' , $ text ) ; $ clearFile = $ this -> homeDir -> makeTempFile ( 'cleartext-' ) ; $ args = array ( '--decrypt' , '--output' , $ clearFile , $ cipherFile ) ; $ output = $ this -> call ( $ args , $ retval ) ; if ( $ retval ) { $ this -> logger -> warning ( 'GPG encrypt call returned error' , array ( 'retval' => $ retval , 'output' => $ output ) ) ; return false ; } $ clearText = file_get_contents ( $ clearFile ) ; if ( ! $ clearText ) { $ this -> logger -> warning ( 'failed to load cleartext file' ) ; return false ; } return $ clearText ; }
For now only used for testing
For now only used for testing