Referred Posts: Amazon S3 & Checksum, How to encode md5 sum into base64 in BASH
I have to download a tar file from S3 bucket with limited access. [ Mostly access permissions given only to download ]
After I download I have to check the md5 check sum of the downloaded file against the MD5-Check Sum of the data present as metadata in S3
I currently use a S3 file browser to manually note the "x-amz-meta-md5" of the content header and validate that value against the computed md5 of the downloaded file.
I would like to know if there is programmatic way using boto to capture the md5 hash value of a S3 file as mentioned as metadata.
from boto.s3.connection import S3Connection
conn = S3Connection(access_key, secret_key)
bucket=conn.get_bucket("test-bucket")
rs_keys = bucket.get_all_keys()
for key_val in rs_keys:
print key_val, key_val.**HOW_TO_GET_MD5_FROM_METADATA(?)**
Please correct if my understanding is wrong. I am looking for a way to capture the header data programmatically