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.SingleResponseExtension and
          asn1crypto.ocsp.ResponseDataExtension 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.SingleResponseExtensionId or
              asn1crypto.ocsp.ResponseDataExtensionId. 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.SingleResponseExtension or
              asn1crypto.ocsp.ResponseDataExtension
          """
  
          if isinstance(name, str_cls):
              response_data_extension_oids = set([
                  'nonce',
                  'extended_revoke',
                  '1.3.6.1.5.5.7.48.1.2',
                  '1.3.6.1.5.5.7.48.1.9'
              ])
  
              single_response_extension_oids = set([
                  'crl',
                  'archive_cutoff',
                  'crl_reason',
                  'invalidity_date',
                  'certificate_issuer',
                  '1.3.6.1.5.5.7.48.1.3',
                  '1.3.6.1.5.5.7.48.1.6',
                  '2.5.29.21',
                  '2.5.29.24',
                  '2.5.29.29'
              ])
  
              if name in response_data_extension_oids:
                  name = ocsp.ResponseDataExtensionId(name)
  
              elif name in single_response_extension_oids:
                  name = ocsp.SingleResponseExtensionId(name)
  
              else:
                  raise ValueError(_pretty_message(
                      '''
                      name must be a unicode string from
                      asn1crypto.ocsp.ResponseDataExtensionId or
                      asn1crypto.ocsp.SingleResponseExtensionId, not %s
                      ''',
                      repr(name)
                  ))
  
          if isinstance(name, ocsp.ResponseDataExtensionId):
              extension = ocsp.ResponseDataExtension({'extn_id': name})
  
          elif isinstance(name, ocsp.SingleResponseExtensionId):
              extension = ocsp.SingleResponseExtension({'extn_id': name})
  
          else:
              raise TypeError(_pretty_message(
                  '''
                  name must be a unicode string or an instance of
                  asn1crypto.ocsp.SingleResponseExtensionId or
                  asn1crypto.ocsp.ResponseDataExtensionId, 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 name == 'nonce':
              raise ValueError(_pretty_message(
                  '''
                  The nonce value should be set via the .nonce attribute, not the
                  .set_extension() method
                  '''
              ))
  
          if name == 'crl_reason':
              raise ValueError(_pretty_message(
                  '''
                  The crl_reason value should be set via the certificate_status
                  parameter of the OCSPResponseBuilder() constructor, not the
                  .set_extension() method
                  '''
              ))
  
          if name == 'certificate_issuer':
              raise ValueError(_pretty_message(
                  '''
                  The certificate_issuer value should be set via the
                  .certificate_issuer attribute, not the .set_extension() method
                  '''
              ))
  
          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.ResponseDataExtension):
              extn_dict = self._response_data_extensions
          else:
              extn_dict = self._single_response_extensions
  
          if value is None:
              if name in extn_dict:
                  del extn_dict[name]
          else:
              extn_dict[name] = value