home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- RSAMD5 = 1
- DH = 2
- DSA = 3
- ECC = 4
- RSASHA1 = 5
- DSANSEC3SHA1 = 6
- RSASHA1NSEC3SHA1 = 7
- RSASHA256 = 8
- RSASHA512 = 10
- INDIRECT = 252
- PRIVATEDNS = 253
- PRIVATEOID = 254
- _algorithm_by_text = {
- 'RSAMD5': RSAMD5,
- 'DH': DH,
- 'DSA': DSA,
- 'ECC': ECC,
- 'RSASHA1': RSASHA1,
- 'DSANSEC3SHA1': DSANSEC3SHA1,
- 'RSASHA1NSEC3SHA1': RSASHA1NSEC3SHA1,
- 'RSASHA256': RSASHA256,
- 'RSASHA512': RSASHA512,
- 'INDIRECT': INDIRECT,
- 'PRIVATEDNS': PRIVATEDNS,
- 'PRIVATEOID': PRIVATEOID }
- _algorithm_by_value = []([ (y, x) for x, y in _algorithm_by_text.iteritems() ])
-
- class UnknownAlgorithm(Exception):
- pass
-
-
- def algorithm_from_text(text):
- value = _algorithm_by_text.get(text.upper())
- if value is None:
- value = int(text)
-
- return value
-
-
- def algorithm_to_text(value):
- text = _algorithm_by_value.get(value)
- if text is None:
- text = str(value)
-
- return text
-
-