public function sign($secret)
    {
        $token     = $this->toString();
        $signature = $this->getSignature($secret);

        return sprintf("%s.%s", $token, $this->_toBase64url($signature));
    }