Bouncy Castle Cryptography Library 1.48

org.bouncycastle.crypto.tls
Class TlsStreamCipher

java.lang.Object
  extended by org.bouncycastle.crypto.tls.TlsStreamCipher
All Implemented Interfaces:
TlsCipher

public class TlsStreamCipher
extends java.lang.Object
implements TlsCipher


Field Summary
protected  TlsClientContext context
           
protected  StreamCipher decryptCipher
           
protected  StreamCipher encryptCipher
           
protected  TlsMac readMac
           
protected  TlsMac writeMac
           
 
Constructor Summary
TlsStreamCipher(TlsClientContext context, StreamCipher encryptCipher, StreamCipher decryptCipher, Digest writeDigest, Digest readDigest, int cipherKeySize)
           
 
Method Summary
protected  byte[] copyData(byte[] text, int offset, int len)
           
 byte[] decodeCiphertext(short type, byte[] ciphertext, int offset, int len)
           
 byte[] encodePlaintext(short type, byte[] plaintext, int offset, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected TlsClientContext context

encryptCipher

protected StreamCipher encryptCipher

decryptCipher

protected StreamCipher decryptCipher

writeMac

protected TlsMac writeMac

readMac

protected TlsMac readMac
Constructor Detail

TlsStreamCipher

public TlsStreamCipher(TlsClientContext context,
                       StreamCipher encryptCipher,
                       StreamCipher decryptCipher,
                       Digest writeDigest,
                       Digest readDigest,
                       int cipherKeySize)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

encodePlaintext

public byte[] encodePlaintext(short type,
                              byte[] plaintext,
                              int offset,
                              int len)
Specified by:
encodePlaintext in interface TlsCipher

decodeCiphertext

public byte[] decodeCiphertext(short type,
                               byte[] ciphertext,
                               int offset,
                               int len)
                        throws java.io.IOException
Specified by:
decodeCiphertext in interface TlsCipher
Throws:
java.io.IOException

copyData

protected byte[] copyData(byte[] text,
                          int offset,
                          int len)

Bouncy Castle Cryptography Library 1.48