MCPcopy Create free account
hub / github.com/SermoDigital/jose / UnmarshalJSON

Method UnmarshalJSON

header.go:51–60  ·  view source on GitHub ↗

UnmarshalJSON implements json.Unmarshaler for Header.

(b []byte)

Source from the content-addressed store, hash-verified

49
50// UnmarshalJSON implements json.Unmarshaler for Header.
51func (h *Header) UnmarshalJSON(b []byte) error {
52 if b == nil {
53 return nil
54 }
55 b, err := DecodeEscaped(b)
56 if err != nil {
57 return err
58 }
59 return json.Unmarshal(b, (*map[string]interface{})(h))
60}
61
62// Protected Headers are base64-encoded after they're marshaled into
63// JSON.

Callers 1

UnmarshalJSONMethod · 0.95

Calls 1

DecodeEscapedFunction · 0.85

Tested by

no test coverage detected