func UnmarshalMetadataBLOBPayload(rawJWT string, options ...UnmarshalOption) (*MetadataBLOBPayload, error) {
	cfg := getConfig(options...)

	tok, err := jwt.ParseSigned(rawJWT)
	if err != nil {
		return nil, err
	}

	var chains [][]*x509.Certificate
	for _, hdr := range tok.Headers {
		hdrChains, err := hdr.Certificates(x509.VerifyOptions{
			Roots: cfg.rootCA,
		})
		if err != nil {
			return nil, err
		}
		chains = append(chains, hdrChains...)
	}
	if len(chains) == 0 || len(chains[0]) == 0 {
		return nil, fmt.Errorf("no x5c certificate found in BLOB payload")
	}

	var payload MetadataBLOBPayload
	err = tok.Claims(chains[0][0].PublicKey, &payload)
	if err != nil {
		return nil, err
	}

	return &payload, nil
}
// UnmarshalMetadataBLOBPayload unmarshals a MetadataBLOBPayload.
UnmarshalMetadataBLOBPayload unmarshals a MetadataBLOBPayload.
// UnmarshalMetadataBLOBPayload unmarshals a MetadataBLOBPayload .
func UnmarshalMetadataBLOBPayload(rawJWT string, options ...UnmarshalOption) (*MetadataBLOBPayload, error) {
	cfg := getConfig(options...)
	tok, err := jwt.ParseSigned(rawJWT)
	if err != nil {
		return nil, err
	}
	var chains [][]*x509.Certificate
	for _, hdr := range tok.Headers {
		hdrChains, err := hdr.Certificates(x509.VerifyOptions{
			Roots: cfg.rootCA,
		})
		if err != nil {
			return nil, err
		}
		chains = append(chains, hdrChains...)
	}
	if len(chains) == 0 || len(chains[0]) == 0 {
		return nil, fmt.Errorf("no x5c certificate found in BLOB payload")
	}
	var payload MetadataBLOBPayload
	err = tok.Claims(chains[0][0].PublicKey, &payload)
	if err != nil {
		return nil, err
	}
	return &payload, nil
}
func UnmarshalMetadataBLOBPayload ( rawJWT string , options ... UnmarshalOption ) ( * MetadataBLOBPayload , error ) { cfg := getConfig ( options ... ) tok , err := jwt . ParseSigned ( rawJWT ) if err != nil { return nil , err } var chains [ ] [ ] * x509 . Certificate for _ , hdr := range tok . Headers { hdrChains , err := hdr . Certificates ( x509 . VerifyOptions { Roots : cfg . rootCA , } ) if err != nil { return nil , err } chains = append ( chains , hdrChains ... ) } if len ( chains ) == 0 || len ( chains [ 0 ] ) == 0 { return nil , fmt . Errorf ( " " ) } var payload MetadataBLOBPayload err = tok . Claims ( chains [ 0 ] [ 0 ] . PublicKey , & payload ) if err != nil { return nil , err } return & payload , nil }
UnmarshalMetadataBLOBPayload unmarshals a MetadataBLOBPayload.
UnmarshalMetadataBLOBPayload unmarshals a MetadataBLOBPayload .