3) { return false; } $algorithm = $key_parts[0]; $key = $key_parts[1]; if (! in_array($algorithm, ['ssh-rsa', 'ssh-dss'])) { return false; } $key_base64_decoded = base64_decode($key, true); if ($key_base64_decoded == false) { return false; } $check = base64_decode(substr($key, 0, 16)); $check = preg_replace("/[^\w\-]/", '', $check); if ((string) $check !== (string) $algorithm) { return false; } return true; } /** * @return array|\Illuminate\Contracts\Translation\Translator|string|null */ public function message() { return __('Invalid key'); } }