code: func domainConfig(cfg *admin.CertificateAuthorityConfig, domain string) *admin.DomainConfig {
  	for _, domainCfg := range cfg.KnownDomains {
  		for _, domainInCfg := range domainCfg.Domain {
  			if domainInCfg == domain || strings.HasSuffix(domain, "."+domainInCfg) {
  				return domainCfg
  			}
  		}
  	}
  	return nil
  }
docs: // domainConfig returns DomainConfig (part of *.cfg file) for a given domain.
  //
  // It enumerates all domains specified in the config finding first domain that
  // is equal to 'domain' or has it as a subdomain.
  //
  // Returns nil if requested domain is not represented in the config.