code: func (*TeleportCertAuthorityMarshaler) UnmarshalCertAuthority(bytes []byte, opts ...MarshalOption) (CertAuthority, error) {
  	cfg, err := collectOptions(opts)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	var h ResourceHeader
  	err = utils.FastUnmarshal(bytes, &h)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	switch h.Version {
  	case "":
  		var ca CertAuthorityV1
  		err := json.Unmarshal(bytes, &ca)
  		if err != nil {
  			return nil, trace.Wrap(err)
  		}
  		return ca.V2(), nil
  	case V2:
  		var ca CertAuthorityV2
  		if cfg.SkipValidation {
  			if err := utils.FastUnmarshal(bytes, &ca); err != nil {
  				return nil, trace.BadParameter(err.Error())
  			}
  		} else {
  			if err := utils.UnmarshalWithSchema(GetCertAuthoritySchema(), &ca, bytes); err != nil {
  				return nil, trace.BadParameter(err.Error())
  			}
  		}
  		if err := ca.CheckAndSetDefaults(); err != nil {
  			return nil, trace.Wrap(err)
  		}
  		if cfg.ID != 0 {
  			ca.SetResourceID(cfg.ID)
  		}
  		return &ca, nil
  	}
  
  	return nil, trace.BadParameter("cert authority resource version %v is not supported", h.Version)
  }
docs: // UnmarshalCertAuthority unmarshals cert authority from JSON