public function generateHeader()
    {
        $format     = 'Rounds="%s", App="%s", Nonce="%s", Token="%s", Realm="%s", User="%s"';
        $expiresAt  = null;

        if ($this->getExpiresAt()) {
            $format = $format . ', ExpiresAt="%s"';
            $expiresAt  = $this->getExpiresAt()->format(\DateTime::ATOM);
        }

        return sprintf(
            $format,
            $this->getRounds(),
            $this->getApp(),
            $this->getNonce(),
            $this->getToken(),
            $this->getRealm(),
            $this->getUser(),
            $expiresAt
        );
    }