home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / dns / dnssec.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  1.3 KB  |  50 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. RSAMD5 = 1
  5. DH = 2
  6. DSA = 3
  7. ECC = 4
  8. RSASHA1 = 5
  9. DSANSEC3SHA1 = 6
  10. RSASHA1NSEC3SHA1 = 7
  11. RSASHA256 = 8
  12. RSASHA512 = 10
  13. INDIRECT = 252
  14. PRIVATEDNS = 253
  15. PRIVATEOID = 254
  16. _algorithm_by_text = {
  17.     'RSAMD5': RSAMD5,
  18.     'DH': DH,
  19.     'DSA': DSA,
  20.     'ECC': ECC,
  21.     'RSASHA1': RSASHA1,
  22.     'DSANSEC3SHA1': DSANSEC3SHA1,
  23.     'RSASHA1NSEC3SHA1': RSASHA1NSEC3SHA1,
  24.     'RSASHA256': RSASHA256,
  25.     'RSASHA512': RSASHA512,
  26.     'INDIRECT': INDIRECT,
  27.     'PRIVATEDNS': PRIVATEDNS,
  28.     'PRIVATEOID': PRIVATEOID }
  29. _algorithm_by_value = []([ (y, x) for x, y in _algorithm_by_text.iteritems() ])
  30.  
  31. class UnknownAlgorithm(Exception):
  32.     pass
  33.  
  34.  
  35. def algorithm_from_text(text):
  36.     value = _algorithm_by_text.get(text.upper())
  37.     if value is None:
  38.         value = int(text)
  39.     
  40.     return value
  41.  
  42.  
  43. def algorithm_to_text(value):
  44.     text = _algorithm_by_value.get(value)
  45.     if text is None:
  46.         text = str(value)
  47.     
  48.     return text
  49.  
  50.