feat: integrated OAuth2 server
This commit is contained in:
1 parent
c418ae6399
commit
adbfb49c11
84 files changed
+2542
-312
No files matched your search
@@ -13,28 +13,28 @@ class Crypt
|
||||
|
||||
public function encrypt(string $message): string
|
||||
{
|
||||
$privateKey = PrivateKey::fromFile($this->path . '/private.key');
|
||||
$privateKey = PrivateKey::fromFile($this->path.'/private.key');
|
||||
|
||||
return $privateKey->encrypt($message);
|
||||
}
|
||||
|
||||
public function decrypt(string $message): string
|
||||
{
|
||||
$publicKey = PublicKey::fromFile($this->path . '/public.key');
|
||||
$publicKey = PublicKey::fromFile($this->path.'/public.key');
|
||||
|
||||
return $publicKey->decrypt($message);
|
||||
}
|
||||
|
||||
public function sign(string $message): string
|
||||
{
|
||||
$privateKey = PrivateKey::fromFile($this->path . '/private.key');
|
||||
$privateKey = PrivateKey::fromFile($this->path.'/private.key');
|
||||
|
||||
return $privateKey->sign($message);
|
||||
}
|
||||
|
||||
public function verify(string $message, string $signature): bool
|
||||
{
|
||||
$publicKey = PublicKey::fromFile($this->path . '/public.key');
|
||||
$publicKey = PublicKey::fromFile($this->path.'/public.key');
|
||||
|
||||
return $publicKey->verify($message, $signature);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user