Class DriveConfig


  • public class DriveConfig
    extends java.lang.Object
    Represents a configuration file for a drive. The properties are encrypted in the file with a master key which is password derived.
    • Constructor Summary

      Constructors 
      Constructor Description
      DriveConfig​(byte[] contents)
      Provide a class that hosts the properties of the drive config file
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear properties.
      byte[] getHashSignature()
      Get the hash signature that was used to sign this drive configuration.
      int getIterations()
      Get the iterations to be used for the key derivation.
      byte[] getIv()
      Get the initial vector that was used to encrypt this drive configuration.
      byte[] getMagicBytes()
      Get the magic bytes from the config file.
      byte[] getSalt()
      Get the salt to be used for the password key derivation.
      static void writeDriveConfig​(IFile configFile, byte[] magicBytes, byte version, byte[] salt, int iterations, byte[] keyIv, byte[] encryptedData, byte[] hashSignature)
      Write the properties of a drive to a config file
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DriveConfig

        public DriveConfig​(byte[] contents)
                    throws java.io.IOException
        Provide a class that hosts the properties of the drive config file
        Parameters:
        contents - The byte array that contains the contents of the config file
        Throws:
        java.io.IOException - Thrown if there is an IO error.
    • Method Detail

      • writeDriveConfig

        public static void writeDriveConfig​(IFile configFile,
                                            byte[] magicBytes,
                                            byte version,
                                            byte[] salt,
                                            int iterations,
                                            byte[] keyIv,
                                            byte[] encryptedData,
                                            byte[] hashSignature)
                                     throws java.io.IOException
        Write the properties of a drive to a config file
        Parameters:
        configFile - The configuration file that will be used to write the content into
        magicBytes - The magic bytes for the header
        version - The version of the file format
        salt - The salt that will be used for encryption of the combined key
        iterations - The iteration that will be used to derive the master key from a text password
        keyIv - The initial vector that was used with the master password to encrypt the combined key
        encryptedData - The encrypted combined key and drive id
        hashSignature - The hash signature of the drive id
        Throws:
        java.io.IOException - Thrown if there is an IO error.
      • clear

        public void clear()
        Clear properties.
      • getMagicBytes

        public byte[] getMagicBytes()
        Get the magic bytes from the config file.
        Returns:
        The magic bytes
      • getSalt

        public byte[] getSalt()
        Get the salt to be used for the password key derivation.
        Returns:
        The salt
      • getIterations

        public int getIterations()
        Get the iterations to be used for the key derivation.
        Returns:
        The iterations
      • getIv

        public byte[] getIv()
        Get the initial vector that was used to encrypt this drive configuration.
        Returns:
        The initial vector
      • getHashSignature

        public byte[] getHashSignature()
        Get the hash signature that was used to sign this drive configuration.
        Returns:
        The hash signature