~rlane/nova/ldapimprovements

« back to all changes in this revision

Viewing changes to nova/crypto.py

  • Committer: Ryan Lane
  • Date: 2010-11-24 15:46:32 UTC
  • mfrom: (382.48.1 trunk)
  • Revision ID: laner@controller-20101124154632-zh7kwjuyyd02a2lh
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
16
#    License for the specific language governing permissions and limitations
17
17
#    under the License.
18
 
 
19
18
"""
20
 
Wrappers around standard crypto, including root and intermediate CAs,
21
 
SSH key_pairs and x509 certificates.
 
19
Wrappers around standard crypto data elements.
 
20
 
 
21
Includes root and intermediate CAs, SSH key_pairs and x509 certificates.
 
22
 
22
23
"""
23
24
 
24
25
import base64
227
228
 
228
229
def compute_md5(fp):
229
230
    """
230
 
    @type fp: file
231
 
    @param fp: File pointer to the file to MD5 hash.  The file pointer will be
 
231
    :type fp: file
 
232
    :param fp: File pointer to the file to MD5 hash.  The file pointer will be
232
233
               reset to the beginning of the file before the method returns.
233
234
 
234
 
    @rtype: tuple
235
 
    @return: the hex digest version of the MD5 hash
 
235
    :rtype: tuple
 
236
    :return: the hex digest version of the MD5 hash
236
237
    """
237
238
    m = hashlib.md5()
238
239
    fp.seek(0)