@@ -38,6 +38,9 @@ discard block |
||
38 | 38 | ]) . LineInterface::EOL; |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param string $line |
|
43 | + */ |
|
41 | 44 | public static function fromLine($line, array $lineOptions) |
42 | 45 | { |
43 | 46 | if (static::validate(\base64_decode($line['signature'], true), $line['line'], $lineOptions['key'])) { |
@@ -52,6 +55,9 @@ discard block |
||
52 | 55 | return \hash_hmac('sha256', $line, $key, true); |
53 | 56 | } |
54 | 57 | |
58 | + /** |
|
59 | + * @param string $signature |
|
60 | + */ |
|
55 | 61 | protected static function validate($signature, $line, $key) |
56 | 62 | { |
57 | 63 | return \hash_equals($signature, static::sign($line, $key)); |