I'm trying to manually decrypt my owncloud's files to test it, but I don't know the PHP language well.
The problem I'm facing is:
PHP Fatal Error: Using $this when not in object context
I looked around for some time, but all I came across was using $this
wrongly along with static methods. But, there aren't any static methods in the files I'm editing.
There's a file 'script.php'
where I'm calling another file's (crypt.php)
methods.
script.php:
<?php
namespace OCA\Files_Encryption\Crypto;
use OCA\Files_Encryption\Crypto\Crypt;
require_once 'crypt.php';
.
.
.
$decryptedUserKey = Crypt::decryptPrivateKey($encryptedUserKey, $userPassword);
.
.
.
Here's the other crypt.php file, where the fatal error occurs crypt.php
<?php
namespace OCA\Files_Encryption\Crypto;
class Crypt {
.
.
.
public function decryptedPrivateKey($privateKey, $password = '', $uid = '') {
$header = $this->parseHeader($privateKey);
.
.
.
}
}
The last line of code throws the fatal error. Any ideas?