\OCP\EncryptionIManager

This class provides access to files encryption apps.

Summary

Methods
Constants
isEnabled()
registerEncryptionModule()
unregisterEncryptionModule()
getEncryptionModules()
getEncryptionModule()
getDefaultEncryptionModuleId()
setDefaultEncryptionModule()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

isEnabled()

isEnabled() : boolean

Check if encryption is available (at least one encryption module needs to be enabled)

Returns

boolean —

true if enabled, false if not

registerEncryptionModule()

registerEncryptionModule(string  $id, string  $displayName, callable  $callback) 

Registers an callback function which must return an encryption module instance

Parameters

string $id
string $displayName
callable $callback

Throws

\OC\Encryption\Exceptions\ModuleAlreadyExistsException

unregisterEncryptionModule()

unregisterEncryptionModule(string  $moduleId) 

Unregisters an encryption module

Parameters

string $moduleId

getEncryptionModules()

getEncryptionModules() : array

get a list of all encryption modules

Returns

array —

[id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]]

getEncryptionModule()

getEncryptionModule(string  $moduleId = '') : \OCP\Encryption\IEncryptionModule

get a specific encryption module

Parameters

string $moduleId

Empty to get the default module

Throws

\OC\Encryption\Exceptions\ModuleDoesNotExistsException

Returns

\OCP\Encryption\IEncryptionModule

getDefaultEncryptionModuleId()

getDefaultEncryptionModuleId() : string

get default encryption module Id

Returns

string

setDefaultEncryptionModule()

setDefaultEncryptionModule(string  $moduleId) : string

set default encryption module Id

Parameters

string $moduleId

Returns

string