Encryption¶
-
class
OC\Files\Storage\Wrapper\Encryption¶ Source: lib/private/Files/Storage/Wrapper/Encryption.php#55 Parent: OC\Files\Storage\Wrapper\WrapperUsed traits: OC\Files\Storage\LocalTempFileTrait
Properties¶
-
protected static property
OC\Files\Storage\Wrapper\Encryption::$unencryptedSize¶ Source: lib/private/Files/Storage/Wrapper/Encryption.php#74 Type: array
Methods¶
-
public
OC\Files\Storage\Wrapper\Encryption::__construct($parameters, $encryptionManager=null, $util=null, $logger=null, $fileHelper=null, $uid=null, $keyStorage=null, $update=null, $mountManager=null, $arrayCache=null)¶ Source: Parameters: - $parameters (array)
- $encryptionManager (
OCP\Encryption\IManager) - $util (
OC\Encryption\Util) - $logger (
OCP\ILogger) - $fileHelper (
OCP\Encryption\IFile) - $uid (string)
- $keyStorage (
OCP\Encryption\Keys\IStorage) - $update (
OC\Encryption\Update) - $mountManager (
OC\Files\Mount\Manager) - $arrayCache (
OC\Memcache\ArrayCache)
-
public
OC\Files\Storage\Wrapper\Encryption::filesize($path)¶ - The result for filesize when called on a folder is required to be 0
Source: Parameters: - $path (string)
Returns: int
-
public
OC\Files\Storage\Wrapper\Encryption::getMetaData($path)¶ Source: lib/private/Files/Storage/Wrapper/Encryption.php#195
-
public
OC\Files\Storage\Wrapper\Encryption::getDirectoryContent($directory)¶ Source: lib/private/Files/Storage/Wrapper/Encryption.php#203
-
public
OC\Files\Storage\Wrapper\Encryption::file_get_contents($path)¶ -
Source: Parameters: - $path (string)
Returns: string
-
public
OC\Files\Storage\Wrapper\Encryption::file_put_contents($path, $data)¶ -
Source: Parameters: - $path (string)
- $data (mixed)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Encryption::unlink($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::rename($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::rmdir($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::isReadable($path)¶ - check if a file can be read
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::copy($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::fopen($path, $mode)¶ -
Source: Parameters: - $path (string)
- $mode (string)
Returns: resource | bool
Throws: Throws: Throws: Throws:
-
protected
OC\Files\Storage\Wrapper\Encryption::verifyUnencryptedSize($path, $unencryptedSize)¶ - perform some plausibility checks if the the unencrypted size is correct.If not, we calculate the correct unencrypted size and return it
Source: Parameters: - $path (string) internal path relative to the storage root
- $unencryptedSize (int) size of the unencrypted file
Returns: int unencrypted size
-
protected
OC\Files\Storage\Wrapper\Encryption::fixUnencryptedSize($path, $size, $unencryptedSize)¶ - calculate the unencrypted size
Source: Parameters: - $path (string) internal path relative to the storage root
- $size (int) size of the physical file
- $unencryptedSize (int) size of the unencrypted file
Returns: int calculated unencrypted size
-
public
OC\Files\Storage\Wrapper\Encryption::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime=true)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage) - $sourceInternalPath (string)
- $targetInternalPath (string)
- $preserveMtime (bool)
Returns: bool
- $sourceStorage (
-
public
OC\Files\Storage\Wrapper\Encryption::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime=false, $isRename=false)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage) - $sourceInternalPath (string)
- $targetInternalPath (string)
- $preserveMtime (bool)
- $isRename (bool)
Returns: bool
- $sourceStorage (
-
public
OC\Files\Storage\Wrapper\Encryption::getLocalFile($path)¶ - get the path to a local version of the file.The local version of the file can be temporary and doesn’t have to be persistent across requests
Source: Parameters: - $path (string)
Returns: string
-
public
OC\Files\Storage\Wrapper\Encryption::isLocal()¶ - Returns the wrapped storage’s value for isLocal()
Source: lib/private/Files/Storage/Wrapper/Encryption.php#800 Returns: bool wrapped storage’s isLocal() value
-
public
OC\Files\Storage\Wrapper\Encryption::stat($path)¶ - only the following keys are required in the result: size and mtime
Source: Parameters: - $path (string)
Returns: array
-
public
OC\Files\Storage\Wrapper\Encryption::hash($type, $path, $raw=false)¶ -
Source: Parameters: - $type (string)
- $path (string)
- $raw (bool)
Returns: string
-
protected
OC\Files\Storage\Wrapper\Encryption::getFullPath($path)¶ - return full path, including mount point
Source: Parameters: - $path (string) relative to mount point
Returns: string full path including mount point
-
protected
OC\Files\Storage\Wrapper\Encryption::readFirstBlock($path)¶ - read first block of encrypted file, typically this will contain theencryption header
Source: Parameters: - $path (string)
Returns: string
-
protected
OC\Files\Storage\Wrapper\Encryption::getHeaderSize($path)¶ - return header size of given file
Source: Parameters: - $path (string)
Returns: int
-
protected
OC\Files\Storage\Wrapper\Encryption::parseRawHeader($rawHeader)¶ - parse raw header to array
Source: Parameters: - $rawHeader (string)
Returns: array
-
protected
OC\Files\Storage\Wrapper\Encryption::getHeader($path)¶ - read header from file
Source: Parameters: - $path (string)
Returns: array
-
protected
OC\Files\Storage\Wrapper\Encryption::getEncryptionModule($path)¶ - read encryption module needed to read/write the file located at $path
Source: Parameters: - $path (string)
Returns: Throws: Throws: \ExceptionThrows: Throws: \Exception
-
public
OC\Files\Storage\Wrapper\Encryption::updateUnencryptedSize($path, $unencryptedSize)¶ Source: Parameters: - $path (string)
- $unencryptedSize (int)
-
protected
OC\Files\Storage\Wrapper\Encryption::copyKeys($source, $target)¶ - copy keys to new location
Source: Parameters: - $source (string) path relative to data/
- $target (string) path relative to data/
Returns: bool
-
protected
OC\Files\Storage\Wrapper\Encryption::isVersion($path)¶ - check if path points to a files version
Source: Parameters: - $path
Returns: bool
-
protected
OC\Files\Storage\Wrapper\Encryption::shouldEncrypt($path)¶ - check if the given storage should be encrypted or not
Source: Parameters: - $path
Returns: bool
-
public
OC\Files\Storage\Wrapper\Encryption::writeStream($path, $stream, $size=null)¶ Source: lib/private/Files/Storage/Wrapper/Encryption.php#1032