code: func (sm *SignedManifest) UnmarshalJSON(b []byte) error {
  	sm.all = make([]byte, len(b))
  	// store manifest and signatures in all
  	copy(sm.all, b)
  
  	jsig, err := libtrust.ParsePrettySignature(b, "signatures")
  	if err != nil {
  		return err
  	}
  
  	// Resolve the payload in the manifest.
  	bytes, err := jsig.Payload()
  	if err != nil {
  		return err
  	}
  
  	// sm.Canonical stores the canonical manifest JSON
  	sm.Canonical = make([]byte, len(bytes))
  	copy(sm.Canonical, bytes)
  
  	// Unmarshal canonical JSON into Manifest object
  	var manifest Manifest
  	if err := json.Unmarshal(sm.Canonical, &manifest); err != nil {
  		return err
  	}
  
  	sm.Manifest = manifest
  
  	return nil
  }
docs: // UnmarshalJSON populates a new SignedManifest struct from JSON data.