You are here

public function OpenSSL::getCipherMethods in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Crypt/Method/OpenSSL.php \Drupal\drd_agent\Crypt\Method\OpenSSL::getCipherMethods()

Get a list of available cipher methods.

Return value

array List of methods.

Overrides BaseMethodInterface::getCipherMethods

File

src/Crypt/Method/OpenSSL.php, line 67

Class

OpenSSL
Provides OpenSSL encryption functionality.

Namespace

Drupal\drd_agent\Crypt\Method

Code

public function getCipherMethods() : array {
  $result = [];
  $available = openssl_get_cipher_methods();
  foreach ($this->supportedCipher as $cipher => $keyLength) {
    if (in_array($cipher, $available, TRUE)) {
      $result[$cipher] = $cipher;
    }
  }
  return $result;
}