public boolean verify(Method method, URI requestUri, String timestamp, String contentHash, String signature) {
        try {
            Instant now = clock.instant(), then = Instant.parse(timestamp);
            if (Duration.between(now, then).abs().compareTo(Duration.ofMinutes(5)) > 0) {
                log.log(INFO, () -> "Rejecting request due to timestamp mismatch of " + Duration.between(now, then));
                return false; // Timestamp mismatch between sender and receiver of more than 5 minutes is not acceptable.
            }

            byte[] canonicalMessage = Signatures.canonicalMessageOf(method.name(), requestUri, timestamp, contentHash);
            verifier.update(canonicalMessage);
            if (verifier.verify(Base64.getDecoder().decode(signature)))
                return true;

            log.log(INFO, () -> "Rejecting request because of signature mismatch");
            return false;
        }
        catch (RuntimeException | SignatureException e) {
            log.log(INFO, () -> "Exception verifying request: " + Exceptions.toMessageString(e));
            return false;
        }
    }
Returns whether the given data is a valid request now, as dictated by timestamp and the decryption key of this.
hosted-api/src/main/java/ai/vespa/hosted/api/RequestVerifier.java