PageRenderTime 10ms CodeModel.GetById 6ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 3The TLS Lite API consists of classes, functions, and variables spread
 4throughout 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
12It's easier to do::
13
14    from tlslite.api import *
15
16This imports all the important objects (TLSConnection, Checker,
17HandshakeSettings, etc.) into the global namespace.  In particular, it
18imports::
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
46from constants import AlertLevel, AlertDescription, Fault
47from errors import *
48from Checker import Checker
49from HandshakeSettings import HandshakeSettings
50from Session import Session
51from SessionCache import SessionCache
52from SharedKeyDB import SharedKeyDB
53from TLSConnection import TLSConnection
54from VerifierDB import VerifierDB
55from X509 import X509
56from X509CertChain import X509CertChain
57
58from integration.HTTPTLSConnection import HTTPTLSConnection
59from integration.TLSSocketServerMixIn import TLSSocketServerMixIn
60from integration.TLSAsyncDispatcherMixIn import TLSAsyncDispatcherMixIn
61from integration.POP3_TLS import POP3_TLS
62from integration.IMAP4_TLS import IMAP4_TLS
63from integration.SMTP_TLS import SMTP_TLS
64from integration.XMLRPCTransport import XMLRPCTransport
65try:
66    import twisted
67    del(twisted)
68    from integration.TLSTwistedProtocolWrapper import TLSTwistedProtocolWrapper
69except ImportError:
70    pass
71
72from utils.cryptomath import cryptlibpyLoaded, m2cryptoLoaded, gmpyLoaded, \
73                             pycryptoLoaded, prngName
74from utils.keyfactory import generateRSAKey, parsePEMKey, parseXMLKey, \
75                             parseAsPublicKey, parsePrivateKey