org.bouncycastle.crypto.tls
Class TlsBlockCipherCipherSuite

java.lang.Object
  extended by org.bouncycastle.crypto.tls.TlsCipherSuite
      extended by org.bouncycastle.crypto.tls.TlsBlockCipherCipherSuite

public class TlsBlockCipherCipherSuite
extends TlsCipherSuite

A generic TLS 1.0 block cipher suite. This can be used for AES or 3DES for example.


Field Summary
private  int cipherKeySize
           
private  BlockCipher decryptCipher
           
private  BlockCipher encryptCipher
           
private  short keyExchange
           
private  Digest readDigest
           
private  TlsMac readMac
           
private  Digest writeDigest
           
private  TlsMac writeMac
           
 
Fields inherited from class org.bouncycastle.crypto.tls.TlsCipherSuite
KE_DH_anon, KE_DH_DSS, KE_DH_RSA, KE_DHE_DSS, KE_DHE_DSS_EXPORT, KE_DHE_RSA, KE_DHE_RSA_EXPORT, KE_RSA, KE_RSA_EXPORT
 
Constructor Summary
protected TlsBlockCipherCipherSuite(BlockCipher encrypt, BlockCipher decrypt, Digest writeDigest, Digest readDigest, int cipherKeySize, short keyExchange)
           
 
Method Summary
protected  byte[] decodeCiphertext(short type, byte[] ciphertext, int offset, int len, TlsProtocolHandler handler)
           
protected  byte[] encodePlaintext(short type, byte[] plaintext, int offset, int len)
           
protected  short getKeyExchangeAlgorithm()
           
protected  void init(byte[] ms, byte[] cr, byte[] sr)
           
private  void initCipher(boolean forEncryption, BlockCipher cipher, byte[] key_block, int key_size, int key_offset, int iv_offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encryptCipher

private BlockCipher encryptCipher

decryptCipher

private BlockCipher decryptCipher

writeDigest

private Digest writeDigest

readDigest

private Digest readDigest

cipherKeySize

private int cipherKeySize

keyExchange

private short keyExchange

writeMac

private TlsMac writeMac

readMac

private TlsMac readMac
Constructor Detail

TlsBlockCipherCipherSuite

protected TlsBlockCipherCipherSuite(BlockCipher encrypt,
                                    BlockCipher decrypt,
                                    Digest writeDigest,
                                    Digest readDigest,
                                    int cipherKeySize,
                                    short keyExchange)
Method Detail

init

protected void init(byte[] ms,
                    byte[] cr,
                    byte[] sr)
Specified by:
init in class TlsCipherSuite

initCipher

private void initCipher(boolean forEncryption,
                        BlockCipher cipher,
                        byte[] key_block,
                        int key_size,
                        int key_offset,
                        int iv_offset)

encodePlaintext

protected byte[] encodePlaintext(short type,
                                 byte[] plaintext,
                                 int offset,
                                 int len)
Specified by:
encodePlaintext in class TlsCipherSuite

decodeCiphertext

protected byte[] decodeCiphertext(short type,
                                  byte[] ciphertext,
                                  int offset,
                                  int len,
                                  TlsProtocolHandler handler)
                           throws java.io.IOException
Specified by:
decodeCiphertext in class TlsCipherSuite
Throws:
java.io.IOException

getKeyExchangeAlgorithm

protected short getKeyExchangeAlgorithm()
Specified by:
getKeyExchangeAlgorithm in class TlsCipherSuite