1 | <?php |
||
19 | class PasswordEncoder implements PasswordEncoderInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | public $auth_magic; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | public $auth_type; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $password_hash_algos; |
||
35 | |||
36 | 811 | public function __construct(EccubeConfig $eccubeConfig) |
|
42 | |||
43 | /** |
||
44 | * Set Auth Magic. |
||
45 | * |
||
46 | * @param $authMagic |
||
47 | */ |
||
48 | public function setAuthMagic($authMagic) |
||
52 | |||
53 | /** |
||
54 | * Checks a raw password against an encoded password. |
||
55 | * |
||
56 | * @param string $encoded An encoded password |
||
57 | * @param string $raw A raw password |
||
58 | * @param string $salt The salt |
||
59 | * |
||
60 | * @return bool true if the password is valid, false otherwise |
||
61 | */ |
||
62 | 2 | public function isPasswordValid($encoded, $raw, $salt) |
|
87 | |||
88 | /** |
||
89 | * Encodes the raw password. |
||
90 | * |
||
91 | * @param string $raw The password to encode |
||
92 | * @param string $salt The salt |
||
93 | * |
||
94 | * @return string The encoded password |
||
95 | */ |
||
96 | 524 | public function encodePassword($raw, $salt) |
|
109 | |||
110 | /** |
||
111 | * saltを生成する. |
||
112 | * |
||
113 | * @param int $length |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | 301 | public function createSalt($length = 5) |
|
121 | |||
122 | public function needsRehash(string $encoded): bool |
||
126 | } |
||
127 |