Generalize group and entry add code.

This commit is contained in:
Brian Pellin committed 2010-06-27 22:12:53 -05:00
1 parent 31cf0bb1c9
commit ae136fb816
13 files changed
+245 -227

No files matched your search

@@ -34,6 +34,8 @@ import com.keepassdroid.database.exception.InvalidKeyFileException;
public class PwDatabaseV4 extends PwDatabase {
public static final Date DEFAULT_NOW = new Date();
public UUID dataCipher;
public PwCompressionAlgorithm compressionAlgorithm;
public long numKeyEncRounds;
@@ -153,4 +155,22 @@ public class PwDatabaseV4 extends PwDatabase {
return PwEncryptionAlgorithm.Rjindal;
}
@Override
public PwGroupIdV4 newGroupId() {
PwGroupIdV4 id = new PwGroupIdV4(UUID_ZERO);
while (true) {
id = new PwGroupIdV4(UUID.randomUUID());
if (!isGroupIdUsed(id)) break;
}
return id;
}
@Override
public PwGroup createGroup() {
return new PwGroupV4();
}
}