func ParsePrivateKey(filePath string) *rsa.PrivateKey {
	keyBytes, err := ioutil.ReadFile(filePath)
	if err != nil {
		log.Fatal("Failed to parse private key.", err)
	}
	return privateKeyDecode(keyBytes)
}
ParsePrivateKey Parses privateKey file
package util
import (
	"crypto/rsa"
	log "github.com/Sirupsen/logrus"
	jwt "github.com/dgrijalva/jwt-go"
	"io/ioutil"
)
func CreateTokenWithPayload(payload map[string]interface{}, privateKey *rsa.PrivateKey) (string, error) {
	token := jwt.New(jwt.GetSigningMethod("RS256"))
	claims := make(jwt.MapClaims)
	for key, value := range payload {
		claims[key] = value
	}
	token.Claims = claims
	signed, err := token.SignedString(privateKey)
	if err != nil {
		log.Errorf("Failed to sign the token using the private key, error %v", err)
		return "", err
	}
	return signed, nil
}