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