Class JetPasswordHandler


  • public class JetPasswordHandler
    extends Object
    Adds, changes and removes the database password on a jet 4 database.

    Two pieces of state have to agree. The password field in page 0 is what makes ms access prompt for a password, and every SID stored in the database is masked with an rc4 keystream whose key is folded out of page 0, the password field included. Writing only the password field produces a database which ms access prompts for and then refuses to open, reporting that the user does not have permission.

    So changing the password means re-masking every SID under the new key, which SidRemasker does.

    Author:
    James Ahlborn
    • Constructor Detail

      • JetPasswordHandler

        public JetPasswordHandler​(Database db)
    • Method Detail

      • setPassword

        public void setPassword​(String password)
                         throws IOException
        Sets the database password, or removes it if the given password is null or empty.
        Throws:
        IOException
      • validateFormat

        public static void validateFormat​(JetFormat format)
        Fails unless the given format holds the password field the way this writes it.