src/Primitive/String/String.php
public function fromEncrypted($encrypted, $key)
    {
        $encrypted = $this->retrieveValue($encrypted);

        $key = $this->retrieveValue($key);

        if ($this->isEncryptedString($encrypted, $key))
        {
            $data = JWT::decode($encrypted, $key);

            return $this->initialize($data->string);
        }

        throw new BadMethodCallException('Expected encrypted String, got: ' . $encrypted);
    }
public function fromEncrypted($encrypted, $key)
    {
        $encrypted = $this->retrieveValue($encrypted);

        $key = $this->retrieveValue($key);

        if ($this->isEncryptedString($encrypted, $key))
        {
            $data = JWT::decode($encrypted, $key);

            return $this->initialize($data->string);
        }

        throw new BadMethodCallException('Expected encrypted String, got: ' . $encrypted);
    }
Construct from proper encrypted String with JWT.

@param string|StringContract $encrypted
@param string|StringContract $key
@return $this