| java.lang.Object com.sun.midp.crypto.Cipher com.sun.midp.crypto.BlockCipherBase com.sun.midp.crypto.DES_ECB com.sun.midp.crypto.DES_CBC
DES_CBC | public class DES_CBC extends DES_ECB (Code) | | DES CBC Cipher algorithm.
|
Constructor Summary | |
public | DES_CBC(boolean useTripleDes) Constructor. |
Method Summary | |
public int | doFinal(byte inBuff, int inOffset, int inLength, byte outBuff, int outOffset) Encrypts or decrypts data in a single-part operation, or finishes a
multiple-part operation. | public void | init(int mode, Key key, CryptoParameter params) Initializes this cipher with a key and a set of algorithm
parameters. | protected void | processBlock(byte[] out, int offset) Depending on the mode, either encrypts or decrypts data block. | protected void | restoreState() Restores cipher state. | protected void | saveState() Saves cipher state. |
DES_CBC | public DES_CBC(boolean useTripleDes)(Code) | | Constructor.
Parameters: useTripleDes - true if the class is being used for triple DES |
doFinal | public int doFinal(byte inBuff, int inOffset, int inLength, byte outBuff, int outOffset) throws IllegalStateException, IllegalBlockSizeException, ShortBufferException, BadPaddingException(Code) | | Encrypts or decrypts data in a single-part operation, or finishes a
multiple-part operation. The data is encrypted or decrypted,
depending on how this cipher was initialized.
Parameters: inBuff - the input buffer Parameters: inOffset - the offset in input where the inputstarts Parameters: inLength - the input length Parameters: outBuff - the buffer for the result Parameters: outOffset - the offset in output where the resultis stored the number of bytes stored in output exception: IllegalStateException - if this cipher is in a wrong state(e.g., has not been initialized) exception: javax.crypto.IllegalBlockSizeException - if this cipher isa block cipher,no padding has been requested (only in encryption mode), and the totalinput length of the data processed by this cipher is not a multiple ofblock size exception: javax.crypto.ShortBufferException - if the given output bufferis too small to hold the result exception: javax.crypto.BadPaddingException - if this cipher is intdecryption mode,and (un)padding has been requested, but the decrypted data is notbounded by the appropriate padding bytes |
processBlock | protected void processBlock(byte[] out, int offset)(Code) | | Depending on the mode, either encrypts or decrypts data block.
Parameters: out - will contain the result of encryptionor decryption operation Parameters: offset - is the offset in out |
restoreState | protected void restoreState()(Code) | | Restores cipher state.
|
saveState | protected void saveState()(Code) | | Saves cipher state.
|
Methods inherited from com.sun.midp.crypto.BlockCipherBase | public int doFinal(byte in, int offset, int len, byte out, int outOffset) throws IllegalStateException, IllegalBlockSizeException, ShortBufferException, BadPaddingException(Code)(Java Doc) protected void doInit(int mode, String keyAlgorithm, Key key, boolean needIV, CryptoParameter params) throws InvalidKeyException, InvalidAlgorithmParameterException(Code)(Java Doc) public byte[] getIV()(Code)(Java Doc) abstract void initKey(byte[] data, int mode) throws InvalidKeyException(Code)(Java Doc) abstract void processBlock(byte[] out, int offset)(Code)(Java Doc) protected void restoreState()(Code)(Java Doc) protected void saveState()(Code)(Java Doc) protected void setPadding(String padding) throws NoSuchPaddingException(Code)(Java Doc) public int update(byte in, int offset, int len, byte out, int outOffset) throws IllegalStateException, ShortBufferException(Code)(Java Doc)
|
Methods inherited from com.sun.midp.crypto.Cipher | abstract public int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException, IllegalBlockSizeException, BadPaddingException(Code)(Java Doc) public byte[] getIV()(Code)(Java Doc) final public static Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException(Code)(Java Doc) public void init(int opmode, Key key) throws InvalidKeyException(Code)(Java Doc) abstract public void init(int opmode, Key key, CryptoParameter params) throws InvalidKeyException, InvalidAlgorithmParameterException(Code)(Java Doc) abstract protected void setChainingModeAndPadding(String mode, String padding) throws NoSuchPaddingException(Code)(Java Doc) abstract public int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException(Code)(Java Doc)
|
|
|