You are here

class TLS in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Crypt/Method/TLS.php \Drupal\drd_agent\Crypt\Method\TLS

Provides security over TLS without additional encryption.

Hierarchy

Expanded class hierarchy of TLS

2 string references to 'TLS'
Base::getMethods in src/Crypt/Base.php
Get a list of crypt methods, either just their ids or instances of each.
TLS::getLabel in src/Crypt/Method/TLS.php
Get the crypt method label.

File

src/Crypt/Method/TLS.php, line 13

Namespace

Drupal\drd_agent\Crypt\Method
View source
class TLS extends BaseMethod {

  /**
   * {@inheritdoc}
   */
  public function getLabel() : string {
    return 'TLS';
  }

  /**
   * {@inheritdoc}
   */
  public function getCipher() : bool {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getPassword() : string {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function isAvailable() : bool {

    // TODO: properly find out if the remote site is running on TLD.
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getCipherMethods() : array {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getIv() : string {
    return '';
  }

  /**
   * {@inheritdoc}
   */
  public function encrypt(array $args) : string {
    return serialize($args);
  }

  /**
   * {@inheritdoc}
   */
  public function decrypt($body, $iv) {

    /** @noinspection UnserializeExploitsInspection */
    return unserialize($body);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseMethod::$container protected property
BaseMethod::$logger protected property
BaseMethod::cryptFileExecute private function Callback to encrypt and decrypt files.
BaseMethod::encryptFile public function Encrypt a file. Overrides BaseMethodInterface::encryptFile
BaseMethod::__construct public function BaseMethod constructor. 2
TLS::decrypt public function Decode, decrypt and unserialize arguments from the other end. Overrides BaseMethodInterface::decrypt
TLS::encrypt public function Encrypt and encode any list of arguments. Overrides BaseMethodInterface::encrypt
TLS::getCipher public function Get the selected cipher. Overrides BaseMethodInterface::getCipher
TLS::getCipherMethods public function Get a list of available cipher methods. Overrides BaseMethodInterface::getCipherMethods
TLS::getIv public function Get an initialiation vector. Overrides BaseMethodInterface::getIv
TLS::getLabel public function Get the crypt method label. Overrides BaseMethodInterface::getLabel
TLS::getPassword public function Get the password. Overrides BaseMethodInterface::getPassword
TLS::isAvailable public function Find out if the crypt method is available. Overrides BaseMethodInterface::isAvailable