1 package org.bouncycastle.crypto;
4 * base interface that a public/private key block cipher needs
7 public interface AsymmetricBlockCipher
10 * initialise the cipher.
12 * @param forEncryption if true the cipher is initialised for
13 * encryption, if false for decryption.
14 * @param param the key and other data required by the cipher.
16 public void init(boolean forEncryption, CipherParameters param);
19 * returns the largest size an input block can be.
21 * @return maximum size for an input block.
23 public int getInputBlockSize();
26 * returns the maximum size of the block produced by this cipher.
28 * @return maximum size of the output block produced by the cipher.
30 public int getOutputBlockSize();
33 * process the block of len bytes stored in in from offset inOff.
35 * @param in the input data
36 * @param inOff offset into the in array where the data starts
37 * @param len the length of the block to be processed.
38 * @return the resulting byte array of the encryption/decryption process.
39 * @exception InvalidCipherTextException data decrypts improperly.
40 * @exception DataLengthException the input data is too large for the cipher.
42 public byte[] processBlock(byte[] in, int inOff, int len)
43 throws InvalidCipherTextException;