| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gudy.bouncycastle.crypto.BufferedAsymmetricBlockCipher
public class BufferedAsymmetricBlockCipher
a buffer wrapper for an asymmetric block cipher, allowing input to be accumulated in a piecemeal fashion until final processing.
| Field Summary | |
|---|---|
protected  byte[] | 
buf
 | 
protected  int | 
bufOff
 | 
| Constructor Summary | |
|---|---|
BufferedAsymmetricBlockCipher(AsymmetricBlockCipher cipher)
base constructor.  | 
|
| Method Summary | |
|---|---|
 byte[] | 
doFinal()
process the contents of the buffer using the underlying cipher.  | 
 int | 
getBufferPosition()
return the amount of data sitting in the buffer.  | 
 int | 
getInputBlockSize()
returns the largest size an input block can be.  | 
 int | 
getOutputBlockSize()
returns the maximum size of the block produced by this cipher.  | 
 AsymmetricBlockCipher | 
getUnderlyingCipher()
return the underlying cipher for the buffer.  | 
 void | 
init(boolean forEncryption,
     CipherParameters params)
initialise the buffer and the underlying cipher.  | 
 void | 
processByte(byte in)
add another byte for processing.  | 
 void | 
processBytes(byte[] in,
             int inOff,
             int len)
add len bytes to the buffer for processing.  | 
 void | 
reset()
Reset the buffer and the underlying cipher.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected byte[] buf
protected int bufOff
| Constructor Detail | 
|---|
public BufferedAsymmetricBlockCipher(AsymmetricBlockCipher cipher)
cipher - the cipher this buffering object wraps.| Method Detail | 
|---|
public AsymmetricBlockCipher getUnderlyingCipher()
public int getBufferPosition()
public void init(boolean forEncryption,
                 CipherParameters params)
forEncryption - if true the cipher is initialised for
  encryption, if false for decryption.param - the key and other data required by the cipher.public int getInputBlockSize()
public int getOutputBlockSize()
public void processByte(byte in)
in - the input byte.
public void processBytes(byte[] in,
                         int inOff,
                         int len)
in - the input datainOff - offset into the in array where the data startslen - the length of the block to be processed.
public byte[] doFinal()
               throws InvalidCipherTextException
InvalidCipherTextException - if we are given a garbage block.public void reset()
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||