func CreateSignature(t *jwt.Token, key interface{}, body string, b64encoded bool) (string, error) {
	var sig, sstr string
	var err error
	if sstr, err = SigningString(t, body, b64encoded); err != nil {
		return "", fmt.Errorf("authentication.CreateSignature: SigningString(t, body) failed: %w", err)
	}

	if sig, err = t.Method.Sign(sstr, key); err != nil {
		return "", fmt.Errorf("authentication.CreateSignature: t.Method.Sign(sstr, key failed: %w", err)
	}
	return strings.Join([]string{sstr, sig}, "."), nil
}
// CreateSignature Get the complete, signed token for jws usage
// Takes the token object, private key, payload body and b64encoding indicator
// Create the signing string which includes the token header and payload body
// Then signs this string using the key provided - the signing algorithm is part of the jwt.Token object
CreateSignature Get the complete, signed token for jws usage
Takes the token object, private key, payload body and b64encoding indicator
Create the signing string which includes the token header and payload body
Then signs this string using the key provided - the signing algorithm is part of the jwt.Token object
// CreateSignature Get the complete signed token for jws usage // Takes the token object private key payload body and b64encoding indicator // Create the signing string which includes the token header and payload body // Then signs this string using the key provided - the signing algorithm is part of the jwt . Token object
func CreateSignature(t *jwt.Token, key interface{}, body string, b64encoded bool) (string, error) {
	var sig, sstr string
	var err error
	if sstr, err = SigningString(t, body, b64encoded); err != nil {
		return "", fmt.Errorf("authentication.CreateSignature: SigningString(t, body) failed: %w", err)
	}
	if sig, err = t.Method.Sign(sstr, key); err != nil {
		return "", fmt.Errorf("authentication.CreateSignature: t.Method.Sign(sstr, key failed: %w", err)
	}
	return strings.Join([]string{sstr, sig}, "."), nil
}
func CreateSignature ( t * jwt . Token , key interface { } , body string , b64encoded bool ) ( string , error ) { var sig , sstr string var err error if sstr , err = SigningString ( t , body , b64encoded ) ; err != nil { return " " , fmt . Errorf ( " " , err ) } if sig , err = t . Method . Sign ( sstr , key ) ; err != nil { return " " , fmt . Errorf ( " " , err ) } return strings . Join ( [ ] string { sstr , sig } , " " ) , nil }
CreateSignature Get the complete, signed token for jws usage
Takes the token object, private key, payload body and b64encoding indicator
Create the signing string which includes the token header and payload body
Then signs this string using the key provided - the signing algorithm is part of the jwt.Token object
CreateSignature Get the complete signed token for jws usage Takes the token object private key payload body and b64encoding indicator Create the signing string which includes the token header and payload body Then signs this string using the key provided - the signing algorithm is part of the jwt . Token object