Package io.jans.lock.trace.crypto
Class TraceHashes
java.lang.Object
io.jans.lock.trace.crypto.TraceHashes
Provider-neutral hash constants and helpers shared by every
TraceCryptoProvider
implementation and by the service. Uses the JDK MessageDigest, so it behaves the same
in the standard and the FIPS WAR variants.- Author:
- Yuriy Movchan
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringsha256Hex(byte[] input) static Stringsha256Prefixed(byte[] input)
-
Field Details
-
SHA256_PREFIX
Prefix of every TRACE hash string.- See Also:
-
ZERO_HASH
The genesis predecessor sentinel:"sha256:"followed by 64 zero digits. -
RECEIPT_PROFILE
Receipt-commitment profile tag (GovOps profile §11). It is thereceipt_profilemember of every receipt-hash input; a different receipt-hash layout needs a new tag.- See Also:
-
-
Method Details
-
sha256Prefixed
- Returns:
"sha256:" + lowercaseHex(SHA-256(input))- Throws:
IllegalArgumentException- ifinputis null
-
sha256Hex
- Returns:
lowercaseHex(SHA-256(input))without prefix, for storage keys- Throws:
IllegalArgumentException- ifinputis null
-