blob: 5ac1102ebc29d5a7267594fbe7c8f7ca7bd480e0 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Illuminate\Contracts\Encryption;
4
5interface Encrypter
6{
7 /**
8 * Encrypt the given value.
9 *
10 * @param mixed $value
11 * @param bool $serialize
12 * @return string
13 *
14 * @throws \Illuminate\Contracts\Encryption\EncryptException
15 */
16 public function encrypt($value, $serialize = true);
17
18 /**
19 * Decrypt the given value.
20 *
21 * @param string $payload
22 * @param bool $unserialize
23 * @return mixed
24 *
25 * @throws \Illuminate\Contracts\Encryption\DecryptException
26 */
27 public function decrypt($payload, $unserialize = true);
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010028
29 /**
30 * Get the encryption key that the encrypter is currently using.
31 *
32 * @return string
33 */
34 public function getKey();
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020035}