func buildSignature(b64 bool, kid, issuer, trustAnchor, body string, alg jwt.SigningMethod, privKey *rsa.PrivateKey) (string, error) {
	var token jwt.Token

	if b64 {
		token = GetSignatureToken314Plus(kid, issuer, trustAnchor, alg)
	} else {
		token = GetSignatureToken313Minus(kid, issuer, trustAnchor, alg)
	}

	tokenString, err := CreateSignature(&token, privKey, body, b64) // sign the token
	if err != nil {
		return "", errors.New("buildSignature: CreateSignature failed " + err.Error())
	}

	logrus.Tracef("Full Request JWT: %s", tokenString)

	detachedJWS := SplitJWSWithBody(tokenString) // remove the body from the signature string to form the detached signature

	return detachedJWS, nil
}
// buildSignature - takes all the token parameters and assembles a detached header signed token string which is returned
// Handles api versions v3.1.4 and above, v3.1.3 and prior, plus v3.0 which has a slightly different JWT header
takes all the token parameters and assembles a detached header signed token string which is returned
Handles api versions v3.1.4 and above, v3.1.3 and prior, plus v3.0 which has a slightly different JWT header
// buildSignature - takes all the token parameters and assembles a detached header signed token string which is returned // Handles api versions v3 . 1 . 4 and above v3 . 1 . 3 and prior plus v3 . 0 which has a slightly different JWT header
func buildSignature(b64 bool, kid, issuer, trustAnchor, body string, alg jwt.SigningMethod, privKey *rsa.PrivateKey) (string, error) {
	var token jwt.Token
	if b64 {
		token = GetSignatureToken314Plus(kid, issuer, trustAnchor, alg)
	} else {
		token = GetSignatureToken313Minus(kid, issuer, trustAnchor, alg)
	}
	tokenString, err := CreateSignature(&token, privKey, body, b64) 
	if err != nil {
		return "", errors.New("buildSignature: CreateSignature failed " + err.Error())
	}
	logrus.Tracef("Full Request JWT: %s", tokenString)
	detachedJWS := SplitJWSWithBody(tokenString) 
	return detachedJWS, nil
}
func buildSignature ( b64 bool , kid , issuer , trustAnchor , body string , alg jwt . SigningMethod , privKey * rsa . PrivateKey ) ( string , error ) { var token jwt . Token if b64 { token = GetSignatureToken314Plus ( kid , issuer , trustAnchor , alg ) } else { token = GetSignatureToken313Minus ( kid , issuer , trustAnchor , alg ) } tokenString , err := CreateSignature ( & token , privKey , body , b64 ) if err != nil { return " " , errors . New ( " " + err . Error ( ) ) } logrus . Tracef ( " " , tokenString ) detachedJWS := SplitJWSWithBody ( tokenString ) return detachedJWS , nil }
takes all the token parameters and assembles a detached header signed token string which is returned
Handles api versions v3.1.4 and above, v3.1.3 and prior, plus v3.0 which has a slightly different JWT header
takes all the token parameters and assembles a detached header signed token string which is returned Handles api versions v3 . 1 . 4 and above v3 . 1 . 3 and prior plus v3 . 0 which has a slightly different JWT header
// sign the token // remove the body from the signature string to form the detached signature