PacketWriter is implemented by two classes: PacketWriterImpl and

PacketEncrypter. The separation allows authentication and encryption
to be tested separately.
This commit is contained in:
akwizgran
2011-08-09 17:50:54 +01:00
parent e9d0021f56
commit f3f0c223c4
9 changed files with 274 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ import java.security.KeyPair;
import java.security.MessageDigest;
import java.security.Signature;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.SecretKey;
@@ -19,5 +20,9 @@ public interface CryptoComponent {
MessageDigest getMessageDigest();
Cipher getPacketCipher();
Signature getSignature();
Cipher getTagCipher();
}

View File

@@ -4,8 +4,8 @@ import java.io.IOException;
import java.io.OutputStream;
/**
* A filter that adds tags and MACs to outgoing packets. Encryption is handled
* by the underlying output stream.
* A filter that adds tags and MACs to outgoing packets, encrypts them and
* writes them to the underlying output stream.
*/
public interface PacketWriter {