Package org.cryptomator.cryptofs.common
Class MasterkeyBackupFileHasher
- java.lang.Object
-
- org.cryptomator.cryptofs.common.MasterkeyBackupFileHasher
-
public final class MasterkeyBackupFileHasher extends Object
Utility class for generating a suffix for the backup file to make it unique to its original master key file.
-
-
Constructor Summary
Constructors Constructor Description MasterkeyBackupFileHasher()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgenerateFileIdSuffix(byte[] fileBytes)Computes the SHA-256 digest of the given byte array and returns a file suffix containing the first 4 bytes in hex string format.
-
-
-
Method Detail
-
generateFileIdSuffix
public static String generateFileIdSuffix(byte[] fileBytes)
Computes the SHA-256 digest of the given byte array and returns a file suffix containing the first 4 bytes in hex string format.- Parameters:
fileBytes- the input byte for which the digest is computed- Returns:
- "." + first 4 bytes of SHA-256 digest in hex string format
-
-