Checker

class OC\IntegrityCheck\Checker
Class Checker handles the code signing using X.509 and RSA. ownCloud ships with
a public root certificate certificate that allows to issue new certificates that
will be trusted for signing code. The CN will be used to verify that a certificate
given to a third-party developer may not be used for other applications. For
example the author of the application “calendar” would only receive a certificate
only valid for this application.
Source:lib/private/IntegrityCheck/Checker.php#60

Constants

CACHE_KEY = oc.integritycheck.checker
Source:lib/private/IntegrityCheck/Checker.php#61

Properties

Methods

public OC\IntegrityCheck\Checker::__construct($environmentHelper, $fileAccessHelper, $appLocator, $config, $cacheFactory, $appManager, $mimeTypeDetector)
Source:

lib/private/IntegrityCheck/Checker.php#86

Parameters:
public OC\IntegrityCheck\Checker::isCodeCheckEnforced()
Whether code signing is enforced or not.
Source:lib/private/IntegrityCheck/Checker.php#107
Returns:bool
public OC\IntegrityCheck\Checker::writeAppSignature($path, $certificate, $privateKey)
Write the signature of the app in the specified folder
Source:

lib/private/IntegrityCheck/Checker.php#251

Parameters:
  • $path (string)
  • $certificate (phpseclib\File\X509)
  • $privateKey (phpseclib\Crypt\RSA)
Throws:

\Exception

public OC\IntegrityCheck\Checker::writeCoreSignature($certificate, $rsa, $path)
Write the signature of core
Source:

lib/private/IntegrityCheck/Checker.php#281

Parameters:
  • $certificate (phpseclib\File\X509)
  • $rsa (phpseclib\Crypt\RSA)
  • $path (string)
Throws:

\Exception

public OC\IntegrityCheck\Checker::hasPassedCheck()
Whether the code integrity check has passed successful or not
Source:lib/private/IntegrityCheck/Checker.php#428
Returns:bool
public OC\IntegrityCheck\Checker::getResults()
Source:lib/private/IntegrityCheck/Checker.php#440
Returns:array
public OC\IntegrityCheck\Checker::verifyAppSignature($appId, $path="", $forceVerify=false)
Verify the signature of $appId. Returns an array with the following content:
[
‘FILE_MISSING’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
‘EXTRA_FILE’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
‘INVALID_HASH’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
]
Array may be empty in case no problems have been found.
Source:

lib/private/IntegrityCheck/Checker.php#512

Parameters:
  • $appId (string)
  • $path (string) Optional path. If none is given it will be guessed.
  • $forceVerify (bool)
Returns:

array

public OC\IntegrityCheck\Checker::verifyCoreSignature()
Verify the signature of core. Returns an array with the following content:
[
‘FILE_MISSING’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
‘EXTRA_FILE’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
‘INVALID_HASH’ =>
[
‘filename’ => [
‘expected’ => ‘expectedSHA512’,
‘current’ => ‘currentSHA512’,
],
],
]
Array may be empty in case no problems have been found.
Source:lib/private/IntegrityCheck/Checker.php#566
Returns:array
public OC\IntegrityCheck\Checker::runInstanceVerification()
Verify the core code of the instance as well as all applicable applications
and store the results.
Source:lib/private/IntegrityCheck/Checker.php#590