docs: def set_extension(self, name, value):
          """
          Sets the value for an extension using a fully constructed
          asn1crypto.core.Asn1Value object. Normally this should not be needed,
          and the convenience attributes should be sufficient.
  
          See the definition of asn1crypto.ocsp.TBSRequestExtension and
          asn1crypto.ocsp.RequestExtension to determine the appropriate object
          type for a given extension. Extensions are marked as critical when RFC
          6960 indicates so.
  
          :param name:
              A unicode string of an extension id name from
              asn1crypto.ocsp.TBSRequestExtensionId or
              asn1crypto.ocsp.RequestExtensionId. If the extension is not one
              defined in those classes, this must be an instance of one of the
              classes instead of a unicode string.
  
          :param value:
              A value object per the specs defined by
              asn1crypto.ocsp.TBSRequestExtension or
              asn1crypto.ocsp.RequestExtension
          """
  
          if isinstance(name, str_cls):
              request_extension_oids = set([
                  'service_locator',
                  '1.3.6.1.5.5.7.48.1.7'
              ])
              tbs_request_extension_oids = set([
                  'nonce',
                  'acceptable_responses',
                  'preferred_signature_algorithms',
                  '1.3.6.1.5.5.7.48.1.2',
                  '1.3.6.1.5.5.7.48.1.4',
                  '1.3.6.1.5.5.7.48.1.8'
              ])
  
              if name in request_extension_oids:
                  name = ocsp.RequestExtensionId(name)
  
              elif name in tbs_request_extension_oids:
                  name = ocsp.TBSRequestExtensionId(name)
  
              else:
                  raise ValueError(_pretty_message(
                      '''
                      name must be a unicode string from
                      asn1crypto.ocsp.TBSRequestExtensionId or
                      asn1crypto.ocsp.RequestExtensionId, not %s
                      ''',
                      repr(name)
                  ))
  
          if isinstance(name, ocsp.RequestExtensionId):
              extension = ocsp.RequestExtension({'extn_id': name})
  
          elif isinstance(name, ocsp.TBSRequestExtensionId):
              extension = ocsp.TBSRequestExtension({'extn_id': name})
  
          else:
              raise TypeError(_pretty_message(
                  '''
                  name must be a unicode string or an instance of
                  asn1crypto.ocsp.TBSRequestExtensionId or
                  asn1crypto.ocsp.RequestExtensionId, not %s
                  ''',
                  _type_name(name)
              ))
  
          # We use native here to convert OIDs to meaningful names
          name = extension['extn_id'].native
          spec = extension.spec('extn_value')
  
          if not isinstance(value, spec) and value is not None:
              raise TypeError(_pretty_message(
                  '''
                  value must be an instance of %s, not %s
                  ''',
                  _type_name(spec),
                  _type_name(value)
              ))
  
          if isinstance(extension, ocsp.TBSRequestExtension):
              extn_dict = self._tbs_request_extensions
          else:
              extn_dict = self._request_extensions
  
          if value is None:
              if name in extn_dict:
                  del extn_dict[name]
          else:
              extn_dict[name] = value