home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / gdata / tlslite / integration / IntegrationHelper.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.3 KB  |  44 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4.  
  5. class IntegrationHelper:
  6.     
  7.     def __init__(self, username = None, password = None, sharedKey = None, certChain = None, privateKey = None, cryptoID = None, protocol = None, x509Fingerprint = None, x509TrustList = None, x509CommonName = None, settings = None):
  8.         self.username = None
  9.         self.password = None
  10.         self.sharedKey = None
  11.         self.certChain = None
  12.         self.privateKey = None
  13.         self.checker = None
  14.         if username and password:
  15.             if not sharedKey and certChain:
  16.                 pass
  17.             if not privateKey:
  18.                 self.username = username
  19.                 self.password = password
  20.             elif username and sharedKey:
  21.                 if not password and certChain:
  22.                     pass
  23.                 if not privateKey:
  24.                     self.username = username
  25.                     self.sharedKey = sharedKey
  26.                 elif certChain and privateKey:
  27.                     if not username and password:
  28.                         pass
  29.                     if not sharedKey:
  30.                         self.certChain = certChain
  31.                         self.privateKey = privateKey
  32.                     elif not password and not username and not sharedKey and not certChain and not privateKey:
  33.                         pass
  34.                     else:
  35.                         raise ValueError('Bad parameters')
  36.                     if not privateKey:
  37.                         if cryptoID and protocol or x509Fingerprint:
  38.                             raise ValueError("Can't use shared keys with other forms ofauthentication")
  39.         x509Fingerprint
  40.         self.checker = Checker(cryptoID, protocol, x509Fingerprint, x509TrustList, x509CommonName)
  41.         self.settings = settings
  42.  
  43.  
  44.