Pix Lib and Validations #2

Merged
bacarin merged 32 commits from bacarin/phpkore:master into master 2025-07-11 18:33:17 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit be5a68f217 - Show all commits

View file

@ -16,5 +16,7 @@
"email": "me@bacarin.dev" "email": "me@bacarin.dev"
} }
], ],
"require": {} "require": {
"phpseclib/phpseclib": "~3.0"
}
} }

View file

@ -2,17 +2,19 @@
namespace Kontrl\PhpKore; namespace Kontrl\PhpKore;
use phpseclib3\Crypt\PublicKeyLoader;
class Kore class Kore
{ {
private $url = 'https://httpbin.org'; private $url = 'https://httpbin.org';
private $token;
public function __construct(){ public function __construct(){
$this->token = $this->auth();
} }
public function auth(){ public function signBody(array $body, string|array $key, string|bool $password = false){
return ''; $publicKey = PublicKeyLoader::loadPrivateKey($key, $password);
return base64_encode($publicKey->sign(json_encode($body)));
} }
public function testRequest(){ public function testRequest(){