Package net.visma.autopay.http.digest
Class DigestVerifier
java.lang.Object
net.visma.autopay.http.digest.DigestVerifier
Verifies values of Content-Digest and Repr-Digest headers
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidverifyDigestHeader(String digestHeader, byte[] content) Verifies provided value of Content-Digest or Repr-Digest header.
-
Method Details
-
verifyDigestHeader
Verifies provided value of Content-Digest or Repr-Digest header. Throws exception on failure.If the header contains multiple digests, those with supported algorithms (defined in
DigestAlgorithm) are verified, and verification succeeds if any of the "supported" digests is correct.- Parameters:
digestHeader- Header read from HTTP request or responsecontent- Binary request or response content. Caller is responsible to use proper encoding, matching Content-Type and Content-Encoding.- Throws:
DigestException- Thrown when provided header is syntactically invalid, or any of supported algorithms is included, or digest is incorrect (does not match the computed one).
-