func ValidateSignatureHeader(token string, b64 bool) error {
	var tokenHeader signatureHeader

	segments := strings.Split(token, ".")
	decodedPayload, _ := base64.RawURLEncoding.DecodeString(segments[0])

	logrus.Trace(string(decodedPayload))

	err := json.Unmarshal(decodedPayload, &tokenHeader)
	if err != nil {
		return fmt.Errorf("ValidateSignatureHeader: cannot convert header into JSON: " + err.Error())
	}

	dumpJSON(tokenHeader)

	err = tokenHeader.validateSignatureHeader(b64) // validate header depent on b64 setting for api true=3.1.4, false=3.1.3

	return err
}
// ValidateSignatureHeader takes a token and performs the header validation
// taking the b64 parameter value in consideration.
ValidateSignatureHeader takes a token and performs the header validation
taking the b64 parameter value in consideration.
// ValidateSignatureHeader takes a token and performs the header validation // taking the b64 parameter value in consideration .
func ValidateSignatureHeader(token string, b64 bool) error {
	var tokenHeader signatureHeader
	segments := strings.Split(token, ".")
	decodedPayload, _ := base64.RawURLEncoding.DecodeString(segments[0])
	logrus.Trace(string(decodedPayload))
	err := json.Unmarshal(decodedPayload, &tokenHeader)
	if err != nil {
		return fmt.Errorf("ValidateSignatureHeader: cannot convert header into JSON: " + err.Error())
	}
	dumpJSON(tokenHeader)
	err = tokenHeader.validateSignatureHeader(b64) 
	return err
}
func ValidateSignatureHeader ( token string , b64 bool ) error { var tokenHeader signatureHeader segments := strings . Split ( token , " " ) decodedPayload , _ := base64 . RawURLEncoding . DecodeString ( segments [ 0 ] ) logrus . Trace ( string ( decodedPayload ) ) err := json . Unmarshal ( decodedPayload , & tokenHeader ) if err != nil { return fmt . Errorf ( " " + err . Error ( ) ) } dumpJSON ( tokenHeader ) err = tokenHeader . validateSignatureHeader ( b64 ) return err }
ValidateSignatureHeader takes a token and performs the header validation
taking the b64 parameter value in consideration.
ValidateSignatureHeader takes a token and performs the header validation taking the b64 parameter value in consideration .
// validate header depent on b64 setting for api true=3.1.4, false=3.1.3