/gdata/tlslite/api.py

http://radioappz.googlecode.com/ · Python · 75 lines · 28 code · 4 blank · 43 comment · 0 complexity · 580a09ad646871155eb93ecf87db37ca MD5 · raw file

  1. """Import this module for easy access to TLS Lite objects.
  2. The TLS Lite API consists of classes, functions, and variables spread
  3. throughout this package. Instead of importing them individually with::
  4. from tlslite.TLSConnection import TLSConnection
  5. from tlslite.HandshakeSettings import HandshakeSettings
  6. from tlslite.errors import *
  7. .
  8. .
  9. It's easier to do::
  10. from tlslite.api import *
  11. This imports all the important objects (TLSConnection, Checker,
  12. HandshakeSettings, etc.) into the global namespace. In particular, it
  13. imports::
  14. from constants import AlertLevel, AlertDescription, Fault
  15. from errors import *
  16. from Checker import Checker
  17. from HandshakeSettings import HandshakeSettings
  18. from Session import Session
  19. from SessionCache import SessionCache
  20. from SharedKeyDB import SharedKeyDB
  21. from TLSConnection import TLSConnection
  22. from VerifierDB import VerifierDB
  23. from X509 import X509
  24. from X509CertChain import X509CertChain
  25. from integration.HTTPTLSConnection import HTTPTLSConnection
  26. from integration.POP3_TLS import POP3_TLS
  27. from integration.IMAP4_TLS import IMAP4_TLS
  28. from integration.SMTP_TLS import SMTP_TLS
  29. from integration.XMLRPCTransport import XMLRPCTransport
  30. from integration.TLSSocketServerMixIn import TLSSocketServerMixIn
  31. from integration.TLSAsyncDispatcherMixIn import TLSAsyncDispatcherMixIn
  32. from integration.TLSTwistedProtocolWrapper import TLSTwistedProtocolWrapper
  33. from utils.cryptomath import cryptlibpyLoaded, m2cryptoLoaded,
  34. gmpyLoaded, pycryptoLoaded, prngName
  35. from utils.keyfactory import generateRSAKey, parsePEMKey, parseXMLKey,
  36. parseAsPublicKey, parsePrivateKey
  37. """
  38. from constants import AlertLevel, AlertDescription, Fault
  39. from errors import *
  40. from Checker import Checker
  41. from HandshakeSettings import HandshakeSettings
  42. from Session import Session
  43. from SessionCache import SessionCache
  44. from SharedKeyDB import SharedKeyDB
  45. from TLSConnection import TLSConnection
  46. from VerifierDB import VerifierDB
  47. from X509 import X509
  48. from X509CertChain import X509CertChain
  49. from integration.HTTPTLSConnection import HTTPTLSConnection
  50. from integration.TLSSocketServerMixIn import TLSSocketServerMixIn
  51. from integration.TLSAsyncDispatcherMixIn import TLSAsyncDispatcherMixIn
  52. from integration.POP3_TLS import POP3_TLS
  53. from integration.IMAP4_TLS import IMAP4_TLS
  54. from integration.SMTP_TLS import SMTP_TLS
  55. from integration.XMLRPCTransport import XMLRPCTransport
  56. try:
  57. import twisted
  58. del(twisted)
  59. from integration.TLSTwistedProtocolWrapper import TLSTwistedProtocolWrapper
  60. except ImportError:
  61. pass
  62. from utils.cryptomath import cryptlibpyLoaded, m2cryptoLoaded, gmpyLoaded, \
  63. pycryptoLoaded, prngName
  64. from utils.keyfactory import generateRSAKey, parsePEMKey, parseXMLKey, \
  65. parseAsPublicKey, parsePrivateKey