1 | <?php |
||
11 | class AuthUtility |
||
12 | { |
||
13 | /** |
||
14 | * Test the specified data against the specified credentials |
||
15 | * |
||
16 | * @param string $password |
||
17 | * @param string $credentials |
||
18 | * |
||
19 | * @return bool |
||
20 | */ |
||
21 | public static function testCredentials($password, $credentials) |
||
51 | |||
52 | /** |
||
53 | * @param string $credentials |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public static function isCredentialVersionLatest($credentials) |
||
61 | |||
62 | /** |
||
63 | * Encrypts a user's password with the latest version of the hash algorithm |
||
64 | * |
||
65 | * @param string $password |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public static function encryptPassword($password) |
||
73 | |||
74 | /** |
||
75 | * @param string $password |
||
76 | * @param string $salt |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | private static function encryptVersion1($password, $salt) |
||
84 | |||
85 | /** |
||
86 | * @param string $password |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | private static function encryptVersion2($password) |
||
94 | |||
95 | /** |
||
96 | * @param string $password |
||
97 | * @param string $hash |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | private static function verifyVersion2($password, $hash) |
||
105 | } |
||
106 |