@param string $key
@param string $message

@return IStringNode
325433
public function hasArrayKeys($key, $message = null) {
        $key = s('%s.#', $key);

        return new StringNode($this, $key, $message);
    }
271188
public function isIntGt0($key, $message = null)
    {
        return $this->check(__FUNCTION__, $key, $message, function ($key) {
            return Str::isInt($this->scope[$key]) && ((int)$this->scope[$key]) > 0;
        });
    }
72602
protected function &getNode(&$node, $key)
    {
        if (is_array($node) && isset($node[$key])) {
            return $node[$key];
        }

        if (!is_object($node) || !isset($node->$key)) {
            $result = null;
            return $result;
        }

        // Special check for __isset and __get
        if (property_exists($node, $key)) {
            return $node->$key;
        }

        if (method_exists($node, '__get')) {
            $value = $node->__get($key);
            return $value;
        }

        $result = null;
        return $result;
    }
22846
public function isJSON($key, $message = null)
    {
        return $this->check(__FUNCTION__, $key, $message, function ($key) {
            return Str::isJSON($this->scope[$key]);
        });
    }
741971
public static function signWithPSS(RSAKey $key, string $message, string $hash): string
    {
        $em = self::encodeEMSAPSS($message, 8 * $key->getModulusLength() - 1, Hash::$hash());
        $message = BigInteger::createFromBinaryString($em);
        $signature = RSAKey::exponentiate($key, $message);

        return self::convertIntegerToOctetString($signature, $key->getModulusLength());
    }
950340
public function setMessage($message)
    {
        if ( ! is_null($message)) $message = (string) $message;

        $this->setAttribute('message', $message);

        return $this;
    }
263040
public function setActionMessage($key, $message) {
        if (!isset($message)) {
            unset($this->attributes[ACTION_MESSAGES_KEY][$key]);
        }
        elseif (is_string($message)) {
            $this->attributes[ACTION_MESSAGES_KEY][$key] = $message;
        }
        else throw new IllegalTypeException('Illegal type of parameter $message: '.gettype($message));
    }
477157
public static function fromString($message)
    {
        $stream = new Stream('php://temp', 'wb+');
        $stream->write($message);
        return self::fromStream($stream);
    }
1129471
public function get(string $key)
    {
        if ($this->replacedPayload) {
            if (! \array_key_exists($key, $this->payload)) {
                throw new \BadMethodCallException("Message payload of {$this->messageName()} does not contain a key $key.");
            }

            return $this->payload[$key];
        }

        if ($key !== self::MESSAGE) {
            throw new \BadMethodCallException(__CLASS__ . ' payload only contains a ' . self::MESSAGE . ' key.');
        }

        return $this->message;
    }
207698
public function encrypt($message, $key, $iv)
    {
        if (!empty($message)) {
            mcrypt_generic_init($this->module, $key, $iv);
            $message = mcrypt_generic($this->module, $message);
            mcrypt_generic_deinit($this->module);
        }

        return $message;
    }
676652
public function isEqual(array $keys, $message = null)
    {
        $existingKey = null;
        foreach ($keys as $key) {
            if (isset($this->scope[$key])) {
                $existingKey = $key;
                break;
            }
        }
        if ($existingKey === null) {
            return $this;
        }

        foreach ($keys as $key) {
            if (isset($this->scope[$key]) && $this->scope[$key] != $this->scope[$existingKey]) {
                $keysList           = implode("', '", $keys);
                $this->errors[$key] = sprintf($message !== null ? $message : self::$isEqualMessage, $keysList);
            }
        }

        return $this;
    }
918354
public function decryptMessage($message)
    {
        $calgo = $this->config->getCipherAlgorithm();
        $cmode = $this->config->getCipherMode();
        $malgo = $this->config->getHmacAlgorithm();
        
        $size = mcrypt_get_iv_size($calgo, $cmode);
        $keySize = mcrypt_get_key_size($calgo, $cmode);
        $hmacSize = strlen(hash_hmac($malgo, '', 'foo-key', true));

        $cmac = substr($message, -1 * $hmacSize);
        $iv = substr($message, 0, $size);
        $cipherText = substr($message, $size, -1 * $hmacSize);
        $hmac = hash_hmac($malgo, $iv . $cipherText, $this->computeCipherKey($this->config->getHmacKey(), $hmacSize, $iv), true);
        
        if(!SecurityUtil::timingSafeEquals($hmac, $cmac))
        {
            throw new IntegrityCheckFailedException('Invalid encrypted input message detected');
        }
        
        $key = $this->computeCipherKey($this->config->getCipherKey(), $keySize, $iv);
        $data = mcrypt_decrypt($calgo, $key, $cipherText, $cmode, $iv);
        
        // PKCS7 Padding
        $pad = ord($data[strlen($data) - 1]);
        $data = substr($data, 0, -1 * $pad);
        
        // Remove zero-byte padding from the string.
        return $data;
    }
187493
public function add($key, $message)
	{
		if ($this->unique($key, $message)) $this->messages[$key][] = $message;
	}
1012897
public function set($key, $message)
    {
        $this->storage->set(self::FLASH_KEY, array($key => $message));
        return $this;
    }
723078
public function message($message=null) {
        if(is_null($message)) {
            return $this->message;
        }
        $this->message = $message;
    }
968390
public static function DecryptMessage ($message, $key, $options = []) {
		$options['module'] = \MCRYPT_MODE_ECB;
		return static::Decrypt($message, $key, $options);
	}
495152
public function parse(Key $key)
    {
        try {
            $resource = $key->getResource();
        } catch (KeyFormatException $e) {
            throw new KeyParsingException('Fail to load resource for key', 0, $e);
        }

        $rawData = openssl_pkey_get_details($resource);
        openssl_free_key($resource);

        if (!\is_array($rawData)) {
            throw new KeyParsingException(sprintf('Fail to parse key with error: %s', openssl_error_string()));
        }

        foreach (['type', 'key', 'bits'] as $requiredKey) {
            if (!isset($rawData[$requiredKey])) {
                throw new KeyParsingException(sprintf('Missing expected key "%s" in OpenSSL key', $requiredKey));
            }
        }

        $details = [];

        if (OPENSSL_KEYTYPE_RSA === $rawData['type']) {
            $details = $rawData['rsa'];
        } elseif (OPENSSL_KEYTYPE_DSA === $rawData['type']) {
            $details = $rawData['dsa'];
        } elseif (OPENSSL_KEYTYPE_DH === $rawData['type']) {
            $details = $rawData['dh'];
        } elseif (OPENSSL_KEYTYPE_EC === $rawData['type']) {
            $details = $rawData['ec'];
        }

        return new ParsedKey($key, $rawData['key'], $rawData['bits'], $rawData['type'], $details);
    }