code: func LoadConfig(config []byte) (*Config, error) {
  	var cfg = &Config{}
  	err := json.Unmarshal(config, &cfg)
  	if err != nil {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy,
  			errors.New("failed to unmarshal configuration: "+err.Error()))
  	}
  
  	if cfg.Signing == nil {
  		return nil, errors.New("No \"signing\" field present")
  	}
  
  	if cfg.Signing.Default == nil {
  		log.Debugf("no default given: using default config")
  		cfg.Signing.Default = DefaultConfig()
  	} else {
  		if err := cfg.Signing.Default.populate(cfg); err != nil {
  			return nil, err
  		}
  	}
  
  	for k := range cfg.Signing.Profiles {
  		if err := cfg.Signing.Profiles[k].populate(cfg); err != nil {
  			return nil, err
  		}
  	}
  
  	if !cfg.Valid() {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy, errors.New("invalid configuration"))
  	}
  
  	log.Debugf("configuration ok")
  	return cfg, nil
  }
docs: // LoadConfig attempts to load the configuration from a byte slice.
  // On error, it returns nil.