Package io.jans.lock.trace.crypto.bc
Class CanonicalHashes
java.lang.Object
io.jans.lock.trace.crypto.bc.CanonicalHashes
SHA-256 digests in the TRACE
sha256:<64 lowercase hex> format over raw bytes or over
the JCS canonical form of a JSON value.
Delegates to TraceHashes, which uses the JDK provider so it behaves the same
in the standard and the FIPS (BouncyCastle FIPS) WAR variants.
- Author:
- Yuriy Movchan
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringsha256Prefixed(byte[] input) static Stringsha256PrefixedOfJcs(com.fasterxml.jackson.databind.JsonNode node)
-
Field Details
-
SHA256_PREFIX
Prefix of every TRACE hash string.- See Also:
-
-
Method Details
-
sha256Prefixed
- Returns:
"sha256:" + lowercaseHex(SHA-256(input))
-
sha256PrefixedOfJcs
- Returns:
"sha256:" + lowercaseHex(SHA-256(UTF-8(JCS(node))))- Throws:
JcsException- if the node cannot be canonicalized
-