params = $params; } /** * @return resource */ public function checkToken() { $finderKey = $this->searchFile(); return \openssl_pkey_get_public($finderKey['public.pem']); } private function searchFile(): array { $contents = []; $file = new Finder(); $files = $file->files()->in($this->params->get('path_key')); foreach ($files as $file) { $contents[$file->getFilename()] = $file->getPathname(); } return $contents; } }