mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Add javadocs.
This commit is contained in:
@@ -132,6 +132,9 @@ public interface CryptoComponent {
|
||||
* storage. The encryption and authentication keys are derived from the
|
||||
* given password. The ciphertext will be decryptable using the same
|
||||
* password after the app restarts.
|
||||
*
|
||||
* @param keyStoreConfig Configures the use of a stored key to strengthen
|
||||
* the password-based key. If null, no stored key will be used
|
||||
*/
|
||||
byte[] encryptWithPassword(byte[] plaintext, String password,
|
||||
@Nullable KeyStoreConfig keyStoreConfig);
|
||||
@@ -141,6 +144,10 @@ public interface CryptoComponent {
|
||||
* storage. The encryption and authentication keys are derived from the
|
||||
* given password. Returns null if the ciphertext cannot be decrypted and
|
||||
* authenticated (for example, if the password is wrong).
|
||||
*
|
||||
* @param keyStoreConfig Configures the use of a stored key to strengthen
|
||||
* the password-based key. If null, or if no stored key was used when
|
||||
* encrypting the ciphertext, then no stored key will be used
|
||||
*/
|
||||
@Nullable
|
||||
byte[] decryptWithPassword(byte[] ciphertext, String password,
|
||||
|
||||
@@ -4,12 +4,20 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
/**
|
||||
* Configures the use of a stored key to strengthen password-based encryption.
|
||||
* The key may be stored in a hardware security module, but this is not
|
||||
* guaranteed. See
|
||||
* {@link CryptoComponent#encryptWithPassword(byte[], String, KeyStoreConfig)}
|
||||
* and
|
||||
* {@link CryptoComponent#decryptWithPassword(byte[], String, KeyStoreConfig)}.
|
||||
*/
|
||||
@NotNullByDefault
|
||||
public interface KeyStoreConfig {
|
||||
|
||||
String getKeyStoreType();
|
||||
|
||||
String getAlias();
|
||||
String getKeyAlias();
|
||||
|
||||
String getProviderName();
|
||||
|
||||
|
||||
@@ -10,10 +10,20 @@ import javax.annotation.Nullable;
|
||||
@NotNullByDefault
|
||||
public interface DatabaseConfig {
|
||||
|
||||
/**
|
||||
* Returns the directory where the database stores its data.
|
||||
*/
|
||||
File getDatabaseDirectory();
|
||||
|
||||
/**
|
||||
* Returns the directory where the encrypted database key is stored.
|
||||
*/
|
||||
File getDatabaseKeyDirectory();
|
||||
|
||||
/**
|
||||
* Returns a {@link KeyStoreConfig} for strengthening the encryption of the
|
||||
* database key, or null if no keystore should be used.
|
||||
*/
|
||||
@Nullable
|
||||
KeyStoreConfig getKeyStoreConfig();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user