Changes between Version 21 and Version 22 of doc/TorRelaySecurity/OfflineKeys


Ignore:
Timestamp:
May 11, 2019, 9:22:28 AM (5 weeks ago)
Author:
toralf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/TorRelaySecurity/OfflineKeys

    v21 v22  
    165165    print time.ctime(int(x[35:38].encode('hex'), 16) * 3600)
    166166}}}
     167
     168In Python3 use somethign like
     169{{{
     170#!/usr/bin/env python3
     171
     172import codecs
     173import time
     174
     175with open('/var/lib/tor/data/keys/ed25519_signing_cert', 'rb') as f:
     176    cert = f.read()
     177    expire = int(codecs.encode(cert[35:38], 'hex'), 16) * 3600
     178    now = time.time()
     179    print(int(expire-now))
     180}}}