Set the encryption key

@param  string $key
@return self
@throws Exception\InvalidArgumentException
321616
public function setKey($key)
    {
        try {
            $this->blockCipher->setKey($key);
        } catch (CryptException\InvalidArgumentException $e) {
            throw new Exception\InvalidArgumentException($e->getMessage());
        }
        $this->encryption['key'] = $key;
        return $this;
    }
763612
public function remove(string $key): self
    {
        $this->data = Arr::remove($this->data, $key);
        return $this;
    }
1043177
public function remove($key)
    {
        $key = strtr(strtolower($key), '_', '-');
        unset($this->_data[$key]);
        return $this;
    }
1210131
public function delete($key)
    {
        $key = (string)$key;

        if (\array_key_exists($key, self::$registry)) {
            unset(self::$registry[$key]);
        }
        return $this;
    }
369656
protected function assertValidKey($key)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'Invalid key: '.var_export($key, true).'. Key should be a string.'
            );
        }

        // valid key according to PSR-6 rules
        $invalid = preg_quote(static::KEY_INVALID_CHARACTERS, '/');
        if (preg_match('/['.$invalid.']/', $key)) {
            throw new InvalidArgumentException(
                'Invalid key: '.$key.'. Contains (a) character(s) reserved '.
                'for future extension: '.static::KEY_INVALID_CHARACTERS
            );
        }
    }
268912
public function unsetOption($key)
    {
        if ($this->hasOption($key))
            $this->options = array_except($this->options, $key);

        return $this;
    }
718921
public function remove(string $key): self
    {
        if (isset($this->headers[$key]) == true) {
            unset($this->headers[$key]);
        }

        return $this;
    }
1266779
public function setKey($key)
    {
        if ($key === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$key")
            );
        }
        $this->setValue("nb_http_render_descriptor_key", $key);

        return $this;
    }
277413
public function remove($key) {
        if (isset($this->_attrs[$key])) {
            unset($this->_attrs[$key]);
        }
        
        return $this;
    }
756116
public function withKey($key)
    {
        $this->lastKey = $key;
        $this->keys[$key] = null;

        return $this;
    }
897531
public function get( $key ) {

		if ( $this->has( $key ) ) {
			return $this->container[strtolower( $key )];
		}

		throw new InvalidArgumentException( "{$key} is unknown" );
	}
1078004
protected function validateKey(/*# string */ &$key)
    {
        // validate key
        if (is_string($key)) {
            $key = trim($key);
            return;
        }

        // throw exception
        throw new InvalidArgumentException(
            Message::get(Message::CACHE_INVALID_KEY, $key),
            Message::CACHE_INVALID_KEY
        );
    }
873964
private function prepareKey($key)
    {
        if (!preg_match('/^[a-zA-Z0-9_-]+$/', $key)) {
            throw new InvalidArgumentException($key);
        }

        return $this->keyPrefix . strtr($key, '-', '_');
    }
728885
public function setLngProperty($key)
    {
        if ($key === null) {
            $this->lngProperty = $key;
            return $this;
        }

        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'The "lng_property" must be a string'
            );
        }

        $this->lngProperty = $key;
        return $this;
    }
1006334
public function normalizeKey($key)
	{
		$normalizedKey = filter_var(
			(preg_match('(^-\\d+$)D', $key)) ? count($this->items) + $key : $key,
			FILTER_VALIDATE_INT,
			[
				'options' => [
					'min_range' => 0,
					'max_range' => count($this->items)
				]
			]
		);

		if ($normalizedKey === false)
		{
			throw new InvalidArgumentException("Invalid offset '" . $key . "'");
		}

		return $normalizedKey;
	}
967189
public static function setApiKey($key) {
        if (self::isValidKey($key)) {
            self::$key = $key;
            self::$useSSL = $key[0] == 'P';
            return true;
        }
        throw new Exceptions\InvalidAPIKeyException("Invalid API key: $key");
    }
610181
public function setKey($key) {

        $cipherKey = substr($key, 0, $this->getKeySize());

        $keyLen = strlen($cipherKey);

        if (!$keyLen) {
            throw new \Cityware\Exception\InvalidArgumentException('The key cannot be empty');
        }
        $keySizes = mcrypt_module_get_supported_key_sizes($this->supportedAlgos[$this->algo]);
        $maxKey = $this->getKeySize();

        /*
         * blowfish has $keySizes empty, meaning it can have arbitrary key length.
         * the others are more picky.
         */
        if (!empty($keySizes) && $keyLen < $maxKey) {

            if (!in_array($keyLen, $keySizes)) {
                throw new \Cityware\Exception\InvalidArgumentException(
                "The size of the key must be one of " . implode(", ", $keySizes) . " bytes or longer"
                );
            }
        }
        $this->key = $cipherKey;

        return $this;
    }