Class 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 Detail

      • MasterkeyBackupFileHasher

        public MasterkeyBackupFileHasher()
    • 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