public function generateParameter()
    {
        $parts = array(
            '', // this is to make sure that token starts with ~
            self::PREFIX_ROUNDS . $this->getRounds(),
            self::PREFIX_APP . $this->getApp(),
            self::PREFIX_NONCE . $this->getNonce(),
            self::PREFIX_TOKEN . $this->getToken(),
            self::PREFIX_REALM . $this->getRealm(),
            self::PREFIX_USER . $this->getUser()
        );

        if ($this->getExpiresAt()) {
            $parts[] = self::PREFIX_EXPIRY . $this->getExpiresAt()->format(\DateTime::ATOM);
        }

        return implode('~', $parts);
    }