func ValidateSignature(jwtToken, body, jwksURI string, b64 bool) (bool, error) {
	err := ValidateSignatureHeader(jwtToken, b64)
	if err != nil {
		return false, err
	}

	kid, err := getKidFromToken(jwtToken)
	if err != nil {
		return false, err
	}

	cert, err := getCertForKid(kid, jwksURI)
	if err != nil {
		return false, err
	}

	signature, err := insertBodyIntoJWT(jwtToken, body, b64) // b64claim
	if err != nil {
		logrus.Errorf("failed to insert body into signature message: %v", err)
		return false, err
	}
	logrus.Trace("Signature with payload: " + signature)

	verified, err := JWSVerify(signature, jwa.PS256, cert.PublicKey, b64)
	if err != nil {
		logrus.Errorf("failed to verify message: %v", err)
		return false, err
	}

	logrus.Tracef("signed message verified! -> %s", verified)

	return true, nil
}
// ValidateSignature takes the signature JWT
// and extracts the kid to lookup the public key in the JWKS
ValidateSignature takes the signature JWT
and extracts the kid to lookup the public key in the JWKS
// ValidateSignature takes the signature JWT // and extracts the kid to lookup the public key in the JWKS
func ValidateSignature(jwtToken, body, jwksURI string, b64 bool) (bool, error) {
	err := ValidateSignatureHeader(jwtToken, b64)
	if err != nil {
		return false, err
	}
	kid, err := getKidFromToken(jwtToken)
	if err != nil {
		return false, err
	}
	cert, err := getCertForKid(kid, jwksURI)
	if err != nil {
		return false, err
	}
	signature, err := insertBodyIntoJWT(jwtToken, body, b64) 
	if err != nil {
		logrus.Errorf("failed to insert body into signature message: %v", err)
		return false, err
	}
	logrus.Trace("Signature with payload: " + signature)
	verified, err := JWSVerify(signature, jwa.PS256, cert.PublicKey, b64)
	if err != nil {
		logrus.Errorf("failed to verify message: %v", err)
		return false, err
	}
	logrus.Tracef("signed message verified! -> %s", verified)
	return true, nil
}
func ValidateSignature ( jwtToken , body , jwksURI string , b64 bool ) ( bool , error ) { err := ValidateSignatureHeader ( jwtToken , b64 ) if err != nil { return false , err } kid , err := getKidFromToken ( jwtToken ) if err != nil { return false , err } cert , err := getCertForKid ( kid , jwksURI ) if err != nil { return false , err } signature , err := insertBodyIntoJWT ( jwtToken , body , b64 ) if err != nil { logrus . Errorf ( " " , err ) return false , err } logrus . Trace ( " " + signature ) verified , err := JWSVerify ( signature , jwa . PS256 , cert . PublicKey , b64 ) if err != nil { logrus . Errorf ( " " , err ) return false , err } logrus . Tracef ( " " , verified ) return true , nil }
ValidateSignature takes the signature JWT
and extracts the kid to lookup the public key in the JWKS
ValidateSignature takes the signature JWT and extracts the kid to lookup the public key in the JWKS
// b64claim