public function getToken()
    {
        $payload = array(
            $this->serializer->toBase64URL($this->serializer->toJSON($this->headers)),
            $this->serializer->toBase64URL($this->serializer->toJSON($this->claims))
        );

        if ($this->signature !== null) {
            $payload[] = $this->serializer->toBase64URL($this->signature);
        }

        return new Token($this->headers, $this->claims, $this->signature, $payload);
    }