# Type of request: This is a ...
[ ] bug report
[x] feature request

# Detailed description
As a Developer,
I want to be able to simulate BadDigest and InvalidDigest errors,
So that I can test the error handling logic

## Expected behavior
https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
BadDigest: The Content-MD5 you specified did not match what we received.
InvalidDigest: The Content-MD5 you specified is not valid.

## Actual behavior
localstack returns InvalidDigest when MD5 does not match payload.


if is_alpine():
        
        flags = '-o' if overwrite else ''
        return run('cd %s; unzip %s %s' % (target_dir, flags, path))
    try:
        zip_ref = zipfile.ZipFile(path, 'r')
    except Exception as e:
        LOG.warning('Unable to open zip file: %s: %s' % (path, e))
        raise e
    
    
    try:
        for file_entry in zip_ref.infolist():
            _unzip_file_entry(zip_ref, file_entry, target_dir)
    finally:
        zip_ref.close()
def _unzip_file_entry(zip_ref, file_entry, target_dir):
    """
    Extracts a Zipfile entry and preserves permissions
    """
    zip_ref.extract(file_entry.filename, path=target_dir)
    out_path = os.path.join(target_dir, file_entry.filename)
    perm = file_entry.external_attr >> 16
    os.chmod(out_path, perm or 0o777)
def untar(path, target_dir):
    mode = 'r:gz' if path.endswith('gz') else 'r'
    with tarfile.open(path, mode) as tar:
        tar.extractall(path=target_dir)
def zip_contains_jar_entries(content, jar_path_prefix=None, match_single_jar=True):