mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Use FortunaGenerator to implement PseudoRandom.
This commit is contained in:
@@ -3,9 +3,12 @@ package org.briarproject.api.crypto;
|
||||
/** A secret key used for encryption and/or authentication. */
|
||||
public class SecretKey {
|
||||
|
||||
public static final int LENGTH = 32; // Bytes
|
||||
|
||||
private final byte[] key;
|
||||
|
||||
public SecretKey(byte[] key) {
|
||||
if(key.length != LENGTH) throw new IllegalArgumentException();
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,17 @@ package org.briarproject.api.db;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.briarproject.api.crypto.SecretKey;
|
||||
|
||||
public interface DatabaseConfig {
|
||||
|
||||
boolean databaseExists();
|
||||
|
||||
File getDatabaseDirectory();
|
||||
|
||||
void setEncryptionKey(byte[] key);
|
||||
void setEncryptionKey(SecretKey key);
|
||||
|
||||
byte[] getEncryptionKey();
|
||||
SecretKey getEncryptionKey();
|
||||
|
||||
long getMaxSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user