Class JetPasswordHandler
- java.lang.Object
-
- com.healthmarketscience.jackcess.crypt.impl.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
SidRemaskerdoes.- Author:
- James Ahlborn
-
-
Constructor Summary
Constructors Constructor Description JetPasswordHandler(Database db)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetPassword(String password)Sets the database password, or removes it if the given password isnullor empty.static voidvalidateFormat(JetFormat format)Fails unless the given format holds the password field the way this writes it.
-
-
-
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 isnullor empty.- Throws:
IOException
-
validateFormat
public static void validateFormat(JetFormat format)
Fails unless the given format holds the password field the way this writes it.
-
-