public class

TlsBlockCipher

extends Object
implements TlsCipher
java.lang.Object
   ↳ org.bouncycastle.crypto.tls.TlsBlockCipher

Class Overview

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

Summary

Fields
protected TlsClientContext context
protected BlockCipher decryptCipher
protected BlockCipher encryptCipher
protected TlsMac readMac
protected TlsMac writeMac
Public Constructors
TlsBlockCipher(TlsClientContext context, BlockCipher encryptCipher, BlockCipher decryptCipher, Digest writeDigest, Digest readDigest, int cipherKeySize)
Public Methods
byte[] decodeCiphertext(short type, byte[] ciphertext, int offset, int len)
byte[] encodePlaintext(short type, byte[] plaintext, int offset, int len)
Protected Methods
int chooseExtraPadBlocks(SecureRandom r, int max)
void initCipher(boolean forEncryption, BlockCipher cipher, byte[] key_block, int key_size, int key_offset, int iv_offset)
int lowestBitSet(int x)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.bouncycastle.crypto.tls.TlsCipher

Fields

protected TlsClientContext context

protected BlockCipher decryptCipher

protected BlockCipher encryptCipher

protected TlsMac readMac

protected TlsMac writeMac

Public Constructors

public TlsBlockCipher (TlsClientContext context, BlockCipher encryptCipher, BlockCipher decryptCipher, Digest writeDigest, Digest readDigest, int cipherKeySize)

Public Methods

public byte[] decodeCiphertext (short type, byte[] ciphertext, int offset, int len)

Throws
IOException

public byte[] encodePlaintext (short type, byte[] plaintext, int offset, int len)

Protected Methods

protected int chooseExtraPadBlocks (SecureRandom r, int max)

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

protected int lowestBitSet (int x)