code: def strip_credentials(message):
      
      message = copy.deepcopy(message)
      for field in ['signature', 'certificate']:
          if field in message:
              del message[field]
      return message
docs: Strip credentials from a message dict.
  
      A new dict is returned without either `signature` or `certificate` keys.
      This method can be called safely; the original dict is not modified.
  
      This function is applicable using either using the x509 or gpg backends.