Code review comment: Yes, this was specifically asked by the service. They want to ensure every docker consumer validates this but they have found customer's not necessarily doing it so they wanted us to put it in the SDK.

Code under review:
Mono<Response<OciManifest>> downloadManifestWithResponse(String tagOrDigest, Context context) {
        if (tagOrDigest == null) {
            return monoError(logger, new NullPointerException("'tagOrDigest' can't be null."));
        }

        return this.registriesImpl.getManifestWithResponseAsync(repositoryName, tagOrDigest, UtilsImpl.OCI_MANIFEST_MEDIA_TYPE, context)
            .flatMap(response -> {
                String digest = response.getHeaders().getValue(UtilsImpl.DOCKER_DIGEST_HEADER_NAME);
                ManifestWrapper wrapper = response.getValue();

                
                
                if (Objects.equals(digest, tagOrDigest) || Objects.equals(response.getValue().getTag(), tagOrDigest)) {
                    OciManifest ociManifest = new OciManifest()
                        .setAnnotations(wrapper.getAnnotations())
                        .setConfig(wrapper.getConfig())
                        .setLayers(wrapper.getLayers())
                        .setSchemaVersion(wrapper.getSchemaVersion());

                    Response<OciManifest> res = new ResponseBase<Void, OciManifest>(
                        response.getRequest(),
                        response.getStatusCode(),
                        response.getHeaders(),
                        ociManifest,
                        null);

                    return Mono.just(res);
                } else {
                    return monoError(logger, new ServiceResponseException("The digest in the response does not match the expected digest."));
                }
            }).onErrorMap(UtilsImpl::mapException);
    }

Line commented on: if (Objects.equals(digest, tagOrDigest) || Objects.equals(response.getValue().getTag(), tagOrDigest)) {

Revised code:
return monoError(logger, new NullPointerException("'tagOrDigest' can't be null."));
        }

        return this.registriesImpl.getManifestWithResponseAsync(repositoryName, tagOrDigest, UtilsImpl.OCI_MANIFEST_MEDIA_TYPE, context)
            .flatMap(response -> {
                String digest = response.getHeaders().getValue(UtilsImpl.DOCKER_DIGEST_HEADER_NAME);
                ManifestWrapper wrapper = response.getValue();

                
                
                if (Objects.equals(digest, tagOrDigest) || Objects.equals(response.getValue().getTag(), tagOrDigest)) {
                    OciManifest ociManifest = new OciManifest()
                        .setAnnotations(wrapper.getAnnotations())
                        .setConfig(wrapper.getConfig())
                        .setLayers(wrapper.getLayers())
                        .setSchemaVersion(wrapper.getSchemaVersion());

                    Response<OciManifest> res = new ResponseBase<Void, OciManifest>(
                        response.getRequest(),
                        response.getStatusCode(),
                        response.getHeaders(),
                        ociManifest,
                        null);

                    return Mono.just(res);
                } else {
                    return monoError(logger, new ServiceResponseException("The digest in the response does not match the expected digest."));
                }
            }