All file objects must have their contents written to stdout.
To get this, use the aws s3 cp command and provide "-" as the destination. $ aws s3 cp s3:/mybucket/stream.txt is an example of a command.
Is this what you're after? ::
#!/bin/bash
BUCKET=your-bucket-name
for key in `aws s3api list-objects --bucket $BUCKET --prefix bucket/path/to/files/ | jq -r '.Contents[].Key'`
do
echo $key
aws s3 cp s3://$BUCKET/$key - | md5sum
Done