How to perform checksum of a file on remote server using Curl?

Hi, We have an AIX server and have CURL 7.40 installed in it.

We are struggling to perform checksum on the file present on the remote server (AWS). We want to validate the checksum on the file pre and post download to make sure that there is no issue with the file.

We are writing a shell script and we are using Curl for FTPS connection and downloading the file from AWS to AIX.

I have copied the code snippet that we have written to list the files and download them.

#list files on AWS server
curl -tlsv1.2 --cacert certs.cer --ftp-ssl --ftp-skip-pasv-ip --list-only --cert ${CERT_USER}:${CERT_USER_PWD} ftp://${USER_NAME}:${USER_PWD}@awscloud.com:50021/Inbox/* > ${LOGS}

#download the files mentioned in the list file
cat ${LOGS} | \
awk '{print $1}' | \
while read FILENAME
do
 echo "File being copied currently is ${FILENAME} "
 curl -tlsv1.2 --cacert certs.cer --ftp-ssl --ftp-skip-pasv-ip --cert ${CERT_USER}:${CERT_USER_PWD} ftp://${USER_NAME}:${USER_PWD}@awscloud.com:50021/Inbox/${FILENAME} -o ${FILENAME}
done