Skip to content
Commit 71593fc7 authored by Damian Johnson's avatar Damian Johnson
Browse files

Detached signature parsing support

Adding a parser for detached signatures, per irl's request...

  https://trac.torproject.org/projects/tor/ticket/28495

You can use stem.descriptor.remote to download these, or parse with
DetachedSignature.from_str(). However, you cannot use parse_file()
until we have a @type annotation for these...

  https://trac.torproject.org/projects/tor/ticket/28615

When downloaded these are only available for five minutes each hour making them
highly clunky to use, but irl suggested he might change that (hope so!). At
present during the window when they're available they can be fetched as
follows...

  ============================================================
  Example script
  ============================================================

  import stem.descriptor.remote

  detached_sigs = stem.descriptor.remote.get_detached_signatures().run()[0]

  for i, sig in enumerate(detached_sigs.signatures):
    print('Signature %i is from %s' % (i + 1, sig.identity))

  ============================================================
  When available (minutes 55-60 of the hour)
  ============================================================

  % python demo.py
  Signature 1 is from 0232AF901C31A04EE9848595AF9BB7620D4C5B2E
  Signature 2 is from 14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4
  Signature 3 is from 23D15D965BC35114467363C165C4F724B64B4F66
  Signature 4 is from 27102BC123E7AF1D4741AE047E160C91ADC76B21
  Signature 5 is from 49015F787433103580E3B66A1707A00E60F2D15B
  Signature 6 is from D586D18309DED4CD6D57C18FDB97EFA96D330566
  Signature 7 is from E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58
  Signature 8 is from ED03BB616EB2F60BEC80151114BB25CEF515B226
  Signature 9 is from EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97

  ============================================================
  When unavailable (minutes 0-55 of the hour)
  ============================================================

  % python demo.py
  Traceback (most recent call last):
    File "demo.py", line 3, in <module>
      detached_sigs = stem.descriptor.remote.get_detached_signatures().run()[0]
    File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 476, in run
      return list(self._run(suppress))
    File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 487, in _run
      raise self.error
  urllib2.HTTPError: HTTP Error 404: Not found
parent f4536b70
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment