Skip to content

Commit

Permalink
Safe storage (#357)
Browse files Browse the repository at this point in the history
* Add safe storage methods

* fix
  • Loading branch information
simonhamp authored Sep 2, 2024
1 parent 6d7b038 commit 5385347
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Facades/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
/**
* @method static bool canPromptTouchID()
* @method static bool promptTouchID(string $reason)
* @method static bool canEncrypt()
* @method static string encrypt(string $string)
* @method static string decrypt(string $string)
* @method static array printers()
* @method static void print(string $html, ?\Native\Laravel\DataObjects\Printer $printer = null)
* @method static string printToPDF(string $reason)
Expand Down
19 changes: 19 additions & 0 deletions src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ public function promptTouchID(string $reason): bool
])->successful();
}

public function canEncrypt(): bool
{
return $this->client->get('system/can-encrypt')->json('result');
}

public function encrypt(string $string): ?string
{
return $this->client->post('system/encrypt', [
'string' => $string,
])->json('result');
}

public function decrypt(string $string): ?string
{
return $this->client->post('system/decrypt', [
'string' => $string,
])->json('result');
}

/**
* @return array<\Native\Laravel\DataObjects\Printer>
*/
Expand Down

0 comments on commit 5385347

Please sign in to comment.