code: def valid_domains(self):
          
  
          if self._valid_domains is None:
              self._valid_domains = []
  
              # For the subject alt name extension, we can look at the name of
              # the choice selected since it distinguishes between domain names,
              # email addresses, IPs, etc
              if self.subject_alt_name_value:
                  for general_name in self.subject_alt_name_value:
                      if general_name.name == 'dns_name' and general_name.native not in self._valid_domains:
                          self._valid_domains.append(general_name.native)
  
              # If there was no subject alt name extension, and the common name
              # in the subject looks like a domain, that is considered the valid
              # list. This is done because according to
              # https://tools.ietf.org/html/rfc6125#section-6.4.4, the common
              # name should not be used if the subject alt name is present.
              else:
                  pattern = re.compile('^(\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]*[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$')
                  for rdn in self.subject.chosen:
                      for name_type_value in rdn:
                          if name_type_value['type'].native == 'common_name':
                              value = name_type_value['value'].native
                              if pattern.match(value):
                                  self._valid_domains.append(value)
  
          return self._valid_domains
docs: :return:
              A list of unicode strings of valid domain names for the certificate.
              Wildcard certificates will have a domain in the form: *.example.com