• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/google.php
  • Класс: CGoogleOAuthInterface
  • Вызов: CGoogleOAuthInterface::fetchPublicKeys
private function fetchPublicKeys(): ?array
{
	if ($this->fetchedPublicKeys)
	{
		return $this->fetchedPublicKeys;
	}

	try
	{
		$publicKeys = $this->getDecodedJson(self::CERTS_URL);
		if (empty($publicKeys['keys']) || count($publicKeys['keys']) < 1)
		{
			return null;
		}

		$parsedPublicKeys = JWK::parseKeySet($publicKeys['keys']);
		foreach ($parsedPublicKeys as $keyId => $publicKey)
		{
			$details = openssl_pkey_get_details($publicKey);
			$this->fetchedPublicKeys[$keyId] = $details['key'];
		}

		return $this->fetchedPublicKeys;
	}
	catch (Exception $e)
	{
	}

	return null;
}