mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Support for decrypting shared secrets and deriving authentication and
encryption keys from them (untested).
This commit is contained in:
@@ -10,6 +10,12 @@ import javax.crypto.SecretKey;
|
||||
|
||||
public interface CryptoComponent {
|
||||
|
||||
SecretKey deriveMacKey(byte[] secret, boolean alice);
|
||||
|
||||
SecretKey derivePacketKey(byte[] secret, boolean alice);
|
||||
|
||||
SecretKey deriveTagKey(byte[] secret, boolean alice);
|
||||
|
||||
KeyPair generateKeyPair();
|
||||
|
||||
SecretKey generateSecretKey();
|
||||
|
||||
18
api/net/sf/briar/api/crypto/SecretStorageKey.java
Normal file
18
api/net/sf/briar/api/crypto/SecretStorageKey.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package net.sf.briar.api.crypto;
|
||||
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import com.google.inject.BindingAnnotation;
|
||||
|
||||
/**
|
||||
* Annotation for injecting the key that is used for encrypting and decrypting
|
||||
* secrets stored in the database.
|
||||
*/
|
||||
@BindingAnnotation
|
||||
@Target({ PARAMETER })
|
||||
@Retention(RUNTIME)
|
||||
public @interface SecretStorageKey {}
|
||||
Reference in New Issue
Block a user