| java.lang.Object com.sun.midp.crypto.Cipher com.sun.midp.crypto.BlockCipherBase com.sun.midp.crypto.AES_ECB
All known Subclasses: com.sun.midp.crypto.AES_CBC,
AES_ECB | public class AES_ECB extends BlockCipherBase (Code) | | This class is an implementation of AES cipher in ECB mode.
|
Field Summary | |
final static int | BLOCK_SIZE AES ciphers encrypt/decrypt in block size of 16 bytes. | protected byte[] | state Internal buffer. |
Constructor Summary | |
public | AES_ECB() Constructor. |
Method Summary | |
protected void | cipherBlock() Performs the encryption of data. | protected void | decipherBlock() Performs the decryption of data. | public void | init(int mode, Key key, CryptoParameter params) Initializes this cipher with a key and a set of algorithm
parameters. | void | initKey(byte[] data, int mode) Initializes key. | protected void | processBlock(byte[] out, int offset) Depending on the mode, either encrypts or decrypts data block. | protected void | setChainingModeAndPadding(String mode, String padding) Called by the factory method to set the mode and padding parameters. |
BLOCK_SIZE | final static int BLOCK_SIZE(Code) | | AES ciphers encrypt/decrypt in block size of 16 bytes.
|
state | protected byte[] state(Code) | | Internal buffer.
|
AES_ECB | public AES_ECB()(Code) | | Constructor.
|
cipherBlock | protected void cipherBlock()(Code) | | Performs the encryption of data.
|
decipherBlock | protected void decipherBlock()(Code) | | Performs the decryption of data.
|
initKey | void initKey(byte[] data, int mode) throws InvalidKeyException(Code) | | Initializes key.
Parameters: data - key data Parameters: mode - cipher mode exception: InvalidKeyException - if the given key is inappropriatefor this cipher |
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 |
setChainingModeAndPadding | protected void setChainingModeAndPadding(String mode, String padding) throws NoSuchPaddingException(Code) | | Called by the factory method to set the mode and padding parameters.
Need because Class.newInstance does not take args.
Parameters: mode - the mode parsed from the transformation parameter ofgetInstance and upper cased Parameters: padding - the paddinge parsed from the transformation parameter ofgetInstance and upper cased |
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)
|
|
|