Defuse\Crypto\File::decryptResource PHP Method

decryptResource() public static method

Takes two resource handles and decrypts the contents of the first, writing the plaintext into the second.
public static decryptResource ( resource $inputHandle, resource $outputHandle, Defuse\Crypto\Key $key )
$inputHandle resource
$outputHandle resource
$key Defuse\Crypto\Key
    public static function decryptResource($inputHandle, $outputHandle, Key $key)
    {
        self::decryptResourceInternal($inputHandle, $outputHandle, KeyOrPassword::createFromKey($key));
    }

Usage Example

 /**
  * Decrypts a stream.
  *
  * @param resource $resource The stream to decrypt.
  *
  * @return resource The decrypted stream.
  */
 private function decryptStream($resource)
 {
     $out = fopen('php://memory', 'r+b');
     File::decryptResource($resource, $out, $this->key());
     rewind($out);
     return $out;
 }
All Usage Examples Of Defuse\Crypto\File::decryptResource