| 1 | <?php |
||
| 8 | class JWTEncrypter implements Encrypter |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Security key. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $key; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Initialize hash with security key. |
||
| 19 | * |
||
| 20 | * @param string $key |
||
| 21 | */ |
||
| 22 | public function __construct($key) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Encrypt the given value. |
||
| 29 | * |
||
| 30 | * @param mixed $value |
||
| 31 | * |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | public function encrypt($value) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Decrypt the given value. |
||
| 41 | * |
||
| 42 | * @param string $value |
||
| 43 | * |
||
| 44 | * @return mixed |
||
| 45 | */ |
||
| 46 | public function decrypt($value) |
||
| 50 | } |
||
| 51 |