| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: module gdata.tlslite.integration.ClientHelper</title> |
| </head><body bgcolor="#f0f0f8"> |
| |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| <tr bgcolor="#7799ee"> |
| <td valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.<a href="gdata.tlslite.html"><font color="#ffffff">tlslite</font></a>.<a href="gdata.tlslite.integration.html"><font color="#ffffff">integration</font></a>.ClientHelper</strong></big></big></font></td |
| ><td align=right valign=bottom |
| ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/tlslite/integration/ClientHelper.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/tlslite/integration/ClientHelper.py</a></font></td></tr></table> |
| <p><tt>A helper class for using TLS Lite with stdlib clients<br> |
| (httplib, xmlrpclib, imaplib, poplib).</tt></p> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ee77aa"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| <td width="100%"><dl> |
| <dt><font face="helvetica, arial"><a href="gdata.tlslite.integration.ClientHelper.html#ClientHelper">ClientHelper</a> |
| </font></dt></dl> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="ClientHelper">class <strong>ClientHelper</strong></a></font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>This is a helper class used to integrate TLS Lite with various<br> |
| TLS clients (e.g. poplib, smtplib, httplib, etc.)<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%">Methods defined here:<br> |
| <dl><dt><a name="ClientHelper-__init__"><strong>__init__</strong></a>(self, username<font color="#909090">=None</font>, password<font color="#909090">=None</font>, sharedKey<font color="#909090">=None</font>, certChain<font color="#909090">=None</font>, privateKey<font color="#909090">=None</font>, cryptoID<font color="#909090">=None</font>, protocol<font color="#909090">=None</font>, x509Fingerprint<font color="#909090">=None</font>, x509TrustList<font color="#909090">=None</font>, x509CommonName<font color="#909090">=None</font>, settings<font color="#909090">=None</font>)</dt><dd><tt>For client authentication, use one of these argument<br> |
| combinations:<br> |
| - username, password (SRP)<br> |
| - username, sharedKey (shared-key)<br> |
| - certChain, privateKey (certificate)<br> |
| <br> |
| For server authentication, you can either rely on the<br> |
| implicit mutual authentication performed by SRP or<br> |
| shared-keys, or you can do certificate-based server<br> |
| authentication with one of these argument combinations:<br> |
| - cryptoID[, protocol] (requires cryptoIDlib)<br> |
| - x509Fingerprint<br> |
| - x509TrustList[, x509CommonName] (requires cryptlib_py)<br> |
| <br> |
| Certificate-based server authentication is compatible with<br> |
| SRP or certificate-based client authentication. It is<br> |
| not compatible with shared-keys.<br> |
| <br> |
| The constructor does not perform the TLS handshake itself, but<br> |
| simply stores these arguments for later. The handshake is<br> |
| performed only when this class needs to connect with the<br> |
| server. Then you should be prepared to handle TLS-specific<br> |
| exceptions. See the client handshake functions in<br> |
| L{tlslite.TLSConnection.TLSConnection} for details on which<br> |
| exceptions might be raised.<br> |
| <br> |
| @type username: str<br> |
| @param username: SRP or shared-key username. Requires the<br> |
| 'password' or 'sharedKey' argument.<br> |
| <br> |
| @type password: str<br> |
| @param password: SRP password for mutual authentication.<br> |
| Requires the 'username' argument.<br> |
| <br> |
| @type sharedKey: str<br> |
| @param sharedKey: Shared key for mutual authentication.<br> |
| Requires the 'username' argument.<br> |
| <br> |
| @type certChain: L{tlslite.X509CertChain.X509CertChain} or<br> |
| L{cryptoIDlib.CertChain.CertChain}<br> |
| @param certChain: Certificate chain for client authentication.<br> |
| Requires the 'privateKey' argument. Excludes the SRP or<br> |
| shared-key related arguments.<br> |
| <br> |
| @type privateKey: L{tlslite.utils.RSAKey.RSAKey}<br> |
| @param privateKey: Private key for client authentication.<br> |
| Requires the 'certChain' argument. Excludes the SRP or<br> |
| shared-key related arguments.<br> |
| <br> |
| @type cryptoID: str<br> |
| @param cryptoID: cryptoID for server authentication. Mutually<br> |
| exclusive with the 'x509...' arguments.<br> |
| <br> |
| @type protocol: str<br> |
| @param protocol: cryptoID protocol URI for server<br> |
| authentication. Requires the 'cryptoID' argument.<br> |
| <br> |
| @type x509Fingerprint: str<br> |
| @param x509Fingerprint: Hex-encoded X.509 fingerprint for<br> |
| server authentication. Mutually exclusive with the 'cryptoID'<br> |
| and 'x509TrustList' arguments.<br> |
| <br> |
| @type x509TrustList: list of L{tlslite.X509.X509}<br> |
| @param x509TrustList: A list of trusted root certificates. The<br> |
| other party must present a certificate chain which extends to<br> |
| one of these root certificates. The cryptlib_py module must be<br> |
| installed to use this parameter. Mutually exclusive with the<br> |
| 'cryptoID' and 'x509Fingerprint' arguments.<br> |
| <br> |
| @type x509CommonName: str<br> |
| @param x509CommonName: The end-entity certificate's 'CN' field<br> |
| must match this value. For a web server, this is typically a<br> |
| server name such as 'www.amazon.com'. Mutually exclusive with<br> |
| the 'cryptoID' and 'x509Fingerprint' arguments. Requires the<br> |
| 'x509TrustList' argument.<br> |
| <br> |
| @type settings: L{tlslite.HandshakeSettings.HandshakeSettings}<br> |
| @param settings: Various settings which can be used to control<br> |
| the ciphersuites, certificate types, and SSL/TLS versions<br> |
| offered by the client.</tt></dd></dl> |
| |
| </td></tr></table></td></tr></table> |
| </body></html> |