IEncryptionModule¶
-
interface
OCP\Encryption\
IEncryptionModule
¶ - Interface IEncryptionModule
Source: lib/public/Encryption/IEncryptionModule.php#38
Methods¶
-
public
OCP\Encryption\IEncryptionModule::
getId
()¶ Source: lib/public/Encryption/IEncryptionModule.php#44 Returns: string defining the technical unique id Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
getDisplayName
()¶ - In comparison to getKey() this function returns a human readable (maybe translated) name
Source: lib/public/Encryption/IEncryptionModule.php#52 Returns: string Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
begin
($path, $user, $mode, $header, $accessList)¶ - start receiving chunks from a file. This is the place where you canperform some initial step before starting encrypting/decrypting thechunks
Source: Parameters: - $path (string) to the file
- $user (string) who read/write the file (null for public access)
- $mode (string) php stream open mode
- $header (array) contains the header data read from the file
- $accessList (array) who has access to the file contains the key ‘users’ and ‘public’
- $return array $header contain data as key-value pairs which should be
written to the header, in case of a write operation or if no additional data is needed return a empty array
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
end
($path, $position)¶ - last chunk received. This is the place where you can perform some finaloperation and return some remaining data if something is left in yourbuffer.
Source: Parameters: - $path (string) to the file
- $position (string) id of the last block (looks like “<Number>end”)
Returns: string remained data which should be written to the file in case of a write operation
Since: 8.1.0
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
encrypt
($data, $position)¶ - encrypt data
Source: Parameters: - $data (string) you want to encrypt
- $position (string) position of the block we want to encrypt (starts with ‘0’)
Returns: mixed encrypted data
Since: 8.1.0
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
decrypt
($data, $position)¶ - decrypt data
Source: Parameters: - $data (string) you want to decrypt
- $position (int | string) position of the block we want to decrypt
Returns: mixed decrypted data
Since: 8.1.0
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
update
($path, $uid, $accessList)¶ - update encrypted file, e.g. give additional users access to the file
Source: Parameters: - $path (string) path to the file which should be updated
- $uid (string) of the user who performs the operation
- $accessList (array) who has access to the file contains the key ‘users’ and ‘public’
Returns: bool
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
shouldEncrypt
($path)¶ - should the file be encrypted or not
Source: Parameters: - $path (string)
Returns: bool
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
getUnencryptedBlockSize
($signed=false)¶ - get size of the unencrypted payload per block.ownCloud read/write files with a block size of 8192 byte
Source: Parameters: - $signed (bool)
Returns: int
Since: 8.1.0 optional parameter $signed was added in 9.0.0
-
public
OCP\Encryption\IEncryptionModule::
isReadable
($path, $uid)¶ - check if the encryption module is able to read the file,e.g. if all encryption keys exists
Source: Parameters: - $path (string)
- $uid (string) user for whom we want to check if he can read the file
Returns: bool
Since: 8.1.0
-
public
OCP\Encryption\IEncryptionModule::
encryptAll
($input, $output)¶ - Initial encryption of all files
Source: Parameters: - $input (
Symfony\Component\Console\Input\InputInterface
) - $output (
Symfony\Component\Console\Output\OutputInterface
) write some status information to the terminal during encryption
Since: 8.2.0
- $input (
-
public
OCP\Encryption\IEncryptionModule::
prepareDecryptAll
($input, $output, $user="")¶ - prepare encryption module to decrypt all files
Source: Parameters: - $input (
Symfony\Component\Console\Input\InputInterface
) - $output (
Symfony\Component\Console\Output\OutputInterface
) write some status information to the terminal during encryption - $user (optional) for which the files should be decrypted, default = all users
Returns: bool return false on failure or if it isn’t supported by the module
Since: 8.2.0
- $input (
-
public
OCP\Encryption\IEncryptionModule::
isReadyForUser
($user)¶ - Check if the module is ready to be used by that specific user.In case a module is not ready - because e.g. key pairs have not been generatedupon login this method can return false before any operation starts and mightcause issues during operations.
Source: Parameters: - $user (string)
Returns: bool
Since: 9.1.0
-
public
OCP\Encryption\IEncryptionModule::
needDetailedAccessList
()¶ - Does the encryption module needs a detailed list of users with access to the file?For example if the encryption module uses per-user encryption keys and needs to knowthe users with access to the file to encrypt/decrypt it.
Source: lib/public/Encryption/IEncryptionModule.php#195 Since: 13.0.0 Returns: bool