This commit is contained in:
Ernir Erlingsson
2016-05-06 11:01:59 +02:00
parent f855c9ea28
commit 64d1e25ad7
25 changed files with 132 additions and 1615 deletions

View File

@@ -84,23 +84,15 @@ public class SetupControllerImp implements SetupController {
@Override
public void createIdentity(final String nickname, final String password,
final ResultHandler<Long> resultHandler) {
LOG.info("createIdentity called");
cryptoExecutor.execute(new Runnable() {
public void run() {
LOG.info("createIdentity running");
SecretKey key = crypto.generateSecretKey();
LOG.info("createIdentity 1");
databaseConfig.setEncryptionKey(key);
LOG.info("createIdentity 2");
String hex = encryptDatabaseKey(key, password);
LOG.info("createIdentity 3");
storeEncryptedDatabaseKey(hex);
LOG.info("createIdentity 4");
final LocalAuthor localAuthor = createLocalAuthor(nickname);
LOG.info("createIdentity 5");
long handle = referenceManager.putReference(localAuthor,
LocalAuthor.class);
LOG.info("createIdentity 6");
resultHandler.onResult(handle);
}
});