code: def _read_signer(key_filename):
      
      filename = key_filename
      if filename is None:
          filename = os.path.join(os.path.expanduser('~'),
                                  '.sawtooth',
                                  'keys',
                                  getpass.getuser() + '.priv')
  
      try:
          with open(filename, 'r') as key_file:
              signing_key = key_file.read().strip()
      except IOError as e:
          raise CliException('Unable to read key file: {}'.format(str(e)))
  
      try:
          private_key = Secp256k1PrivateKey.from_hex(signing_key)
      except ParseError as e:
          raise CliException('Unable to read key in file: {}'.format(str(e)))
  
      context = create_context('secp256k1')
      crypto_factory = CryptoFactory(context)
      return crypto_factory.new_signer(private_key)
docs: Reads the given file as a hex key.
  
      Args:
          key_filename: The filename where the key is stored. If None,
              defaults to the default key for the current user.
  
      Returns:
          Signer: the signer
  
      Raises:
          CliException: If unable to read the file.