Encrypt logs on disk, store encryption key in DB.

This commit is contained in:
akwizgran
2018-10-23 14:18:31 +01:00
parent 61407c3e06
commit d9b4c013bb
12 changed files with 190 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
package org.briarproject.briar.api.logging;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.settings.Settings;
import java.io.File;
import java.io.IOException;
@@ -10,7 +11,25 @@ import java.util.logging.Handler;
@NotNullByDefault
public interface PersistentLogManager {
/**
* The namespace of the (@link Settings) where the log key is stored.
*/
String LOG_SETTINGS_NAMESPACE = "log";
/**
* The {@link Settings} key under which the log key is stored.
*/
String LOG_KEY_KEY = "logKey";
/**
* Creates and returns a persistent log handler that stores its logs in
* the given directory.
*/
Handler createLogHandler(File dir) throws IOException;
/**
* Loads and returns the persistent log entries stored in the given
* directory, or an empty list if no log entries are found.
*/
Collection<String> getPersistedLog(File dir) throws IOException;
}