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