You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: jwttoken.go
    path of file: ./repos/shellhub/pkg/api/jwttoken
    
    the code of the file until where you have to start completion: package jwttoken

import (
	"crypto/rsa"
	"errors"
	"time"

	"github.com/golang-jwt/jwt/v4"
	"github.com/shellhub-io/shellhub/pkg/clock"
	"github.com/shellhub-io/shellhub/pkg/uuid"
)

var ErrMissingPrivateKey = errors.New("missing private key while trying to sign the token")

type Claims interface {
	jwt.Claims
	SetRegisteredClaims(claims jwt.RegisteredClai
    
func (t *Token) Sign() (*Token, error) {
	if t.privateKey == nil {
		return nil, ErrMissingPrivateKey
	}

	var token *jwt.Token
	if t.claims != nil {
		token = jwt.NewWithClaims(t.method, t.claims)
	} else {
		token = jwt.NewWithClaims(t.method, t.registeredClaims)
	}

	tokenStr, err := token.SignedString(t.privateKey)
	if err != nil {
		return nil, err
	}

	t.raw = token
	t.str = tokenStr

	return t, nil
}