public function Base::getCryptInstance in DRD Agent 8.3
Same name and namespace in other branches
- 4.0.x src/Agent/Action/Base.php \Drupal\drd_agent\Agent\Action\Base::getCryptInstance()
Get authorised Crypt object or FALSE if none is available.
Parameters
string $uuid: UUID of the crypt instance that should be loaded.
Return value
\Drupal\drd_agent\Crypt\BaseMethodInterface|bool The loaded Crypt instance if available or FALSE otherwise.
Overrides BaseInterface::getCryptInstance
1 call to Base::getCryptInstance()
File
- src/
Agent/ Action/ Base.php, line 414
Class
- Base
- Base class for Remote DRD Action Code.
Namespace
Drupal\drd_agent\Agent\ActionCode
public function getCryptInstance($uuid) {
$config = $this->configFactory
->get('drd_agent.settings');
$authorised = $config
->get('authorised') ?? [];
if (empty($authorised[$uuid])) {
return FALSE;
}
return CryptBase::getInstance($this->container, $authorised[$uuid]['crypt'], (array) $authorised[$uuid]['cryptsetting']);
}