|
|
|
|
|
|
|
|
* @param string $signaturePath |
|
|
* @param string $signaturePath |
|
|
* @param string $basePath |
|
|
* @param string $basePath |
|
|
* @param string $certificateCN |
|
|
* @param string $certificateCN |
|
|
|
|
|
* @param bool $forceVerify |
|
|
* @return array |
|
|
* @return array |
|
|
* @throws InvalidSignatureException |
|
|
* @throws InvalidSignatureException |
|
|
* @throws \Exception |
|
|
* @throws \Exception |
|
|
*/ |
|
|
*/ |
|
|
private function verify(string $signaturePath, string $basePath, string $certificateCN): array { |
|
|
|
|
|
if (!$this->isCodeCheckEnforced()) { |
|
|
|
|
|
|
|
|
private function verify(string $signaturePath, string $basePath, string $certificateCN, bool $forceVerify = false): array { |
|
|
|
|
|
if (!$forceVerify && !$this->isCodeCheckEnforced()) { |
|
|
return []; |
|
|
return []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* |
|
|
* |
|
|
* @param string $appId |
|
|
* @param string $appId |
|
|
* @param string $path Optional path. If none is given it will be guessed. |
|
|
* @param string $path Optional path. If none is given it will be guessed. |
|
|
|
|
|
* @param bool $forceVerify |
|
|
* @return array |
|
|
* @return array |
|
|
*/ |
|
|
*/ |
|
|
public function verifyAppSignature(string $appId, string $path = ''): array { |
|
|
|
|
|
|
|
|
public function verifyAppSignature(string $appId, string $path = '', bool $forceVerify = false): array { |
|
|
try { |
|
|
try { |
|
|
if ($path === '') { |
|
|
if ($path === '') { |
|
|
$path = $this->appLocator->getAppPath($appId); |
|
|
$path = $this->appLocator->getAppPath($appId); |
|
|
|
|
|
|
|
|
$result = $this->verify( |
|
|
$result = $this->verify( |
|
|
$path . '/appinfo/signature.json', |
|
|
$path . '/appinfo/signature.json', |
|
|
$path, |
|
|
$path, |
|
|
$appId |
|
|
|
|
|
|
|
|
$appId, |
|
|
|
|
|
$forceVerify |
|
|
); |
|
|
); |
|
|
} catch (\Exception $e) { |
|
|
} catch (\Exception $e) { |
|
|
$result = [ |
|
|
$result = [ |