func ParseSigned(signature string) (*JSONWebSignature, error) {
	signature = stripWhitespace(signature)
	if strings.HasPrefix(signature, "{") {
		return parseSignedFull(signature)
	}
	return parseSignedCompact(signature, nil)
}
ParseSigned parses a signed message in compact or full serialization format.
package jose
import (
	"bytes"
	"encoding/base64"
	"errors"
	"fmt"
	"strings"
	"gopkg.in/square/go-jose.v2/json"
)
type rawJSONWebSignature struct {
	Payload    *byteBuffer        `json:"payload,omitempty"`
	Signatures []rawSignatureInfo `json:"signatures,omitempty"`
	Protected  *byteBuffer        `json:"protected,omitempty"`
	Header     *rawHeader         `json:"header,omitempty"`
	Signature  *byteBuffer        `json:"signature,omitempty"`
}
type rawSignatureInfo struct {
	Protected *byteBuffer `json:"protected,omitempty"`
	Header    *rawHeader  `json:"header,omitempty"`
	Signature *byteBuffer `json:"signature,omitempty"`
}
type JSONWebSignature struct {
	payload []byte
	Signatures []Signature
}
type Signature struct {
	Header Header
	Protected Header
	Unprotected Header
	Signature []byte
	protected *rawHeader
	header    *rawHeader
	original  *rawSignatureInfo
}