func (p *Protected) UnmarshalJSON(b []byte) error {
	var h Header
	if err := h.UnmarshalJSON(b); err != nil {
		return err
	}
	*p = Protected(h)
	return nil
}
UnmarshalJSON implements json.Unmarshaler for Protected.
package jose
import "encoding/json"
type Header map[string]interface{}
func (h Header) Get(key string) interface{} {
	if h == nil {
		return nil
	}
	return h[key]
}
func (h Header) Set(key string, val interface{}) {
	h[key] = val
}
func (h Header) Del(key string) {
	delete(h, key)
}
func (h Header) Has(key string) bool {
	_, ok := h[key]
	return ok
}
func (h Header) MarshalJSON() ([]byte, error) {
	if len(h) == 0 {
		return nil, nil
	}
	b, err := json.Marshal(map[string]interface{}(h))
	if err != nil {
		return nil, err
	}
	return EncodeEscape(b), nil
}
func (h Header) Base64() ([]byte, error) {
	return h.MarshalJSON()
}
func (h *Header) UnmarshalJSON(b []byte) error {
	if b == nil {
		return nil
	}
	b, err := DecodeEscaped(b)
	if err != nil {
		return err
	}
	return json.Unmarshal(b, (*map[string]interface{})(h))
}
type Protected Header
func (p Protected) Get(key string) interface{} {
	if p == nil {
		return nil
	}
	return p[key]
}
func (p Protected) Set(key string, val interface{}) {
	p[key] = val
}
func (p Protected) Del(key string) {
	delete(p, key)
}
func (p Protected) Has(key string) bool {
	_, ok := p[key]
	return ok
}
func (p Protected) MarshalJSON() ([]byte, error) {
	b, err := json.Marshal(map[string]interface{}(p))
	if err != nil {
		return nil, err
	}
	return EncodeEscape(b), nil
}
func (p Protected) Base64() ([]byte, error) {
	b, err := json.Marshal(map[string]interface{}(p))
	if err != nil {
		return nil, err
	}
	return Base64Encode(b), nil
}