| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | static public function decryptData(string $sessionKey, string $iv, string $encrypted): array |
||
| 35 | { |
||
| 36 | $decrypted = AES::decrypt( |
||
| 37 | base64_decode($encrypted, false), |
||
| 38 | base64_decode($sessionKey, false), |
||
| 39 | base64_decode($iv, false) |
||
| 40 | ); |
||
| 41 | |||
| 42 | $decrypted = json_decode($decrypted, true); |
||
| 43 | |||
| 44 | if (!$decrypted) { |
||
| 45 | throw new OAuthException("The given payload is invalid."); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $decrypted; |
||
| 49 | } |
||
| 51 |