Support for decrypting shared secrets and deriving authentication and

encryption keys from them (untested).
This commit is contained in:
akwizgran
2011-08-11 17:15:36 +01:00
parent 3edfa5d1ba
commit df972e294d
3 changed files with 126 additions and 33 deletions

View File

@@ -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();

View 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 {}