totalcross.crypto.cipher
Class AESCipher

totalcross.lang.Object
  extended by totalcross.crypto.cipher.Cipher
      extended by totalcross.crypto.cipher.AESCipher

public class AESCipher
extends Cipher

This class implements the AES cryptographic cipher.

If you get a totalcross.crypto.CryptoException: Illegal key size, you must download the strong cryptography files from here AFTER understanding that you are elligible to do so as stated in here (search for 'Unlimited Strength Java Cryptography Extension' - installation instructions are inside that topic).


Field Summary
 
Fields inherited from class totalcross.crypto.cipher.Cipher
chaining, CHAINING_CBC, CHAINING_ECB, CHAINING_NONE, iv, key, nativeHeap, operation, OPERATION_DECRYPT, OPERATION_ENCRYPT, padding, PADDING_NONE, PADDING_PKCS1, PADDING_PKCS5
 
Constructor Summary
AESCipher()
           
 
Method Summary
protected  void doReset()
           
 String getAlgorithm()
           
 int getBlockLength()
           
protected  boolean isChainingSupported(int chaining)
           
protected  boolean isKeySupported(Key key, int operation)
           
protected  boolean isPaddingSupported(int padding)
           
protected  byte[] process(byte[] data)
           
 
Methods inherited from class totalcross.crypto.cipher.Cipher
getIV, getOutput, reset, reset, reset, reset, toString, update, update, update
 
Methods inherited from class totalcross.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AESCipher

public AESCipher()
Method Detail

getAlgorithm

public final String getAlgorithm()
Specified by:
getAlgorithm in class Cipher
Returns:
the algorithm name of this cipher.

getBlockLength

public final int getBlockLength()
Specified by:
getBlockLength in class Cipher
Returns:
the block length (in bytes), or 0 if the underlying algorithm is not a block cipher.

doReset

protected final void doReset()
                      throws CryptoException
Specified by:
doReset in class Cipher
Throws:
CryptoException

process

protected final byte[] process(byte[] data)
                        throws CryptoException
Specified by:
process in class Cipher
Throws:
CryptoException

isKeySupported

protected final boolean isKeySupported(Key key,
                                       int operation)
Specified by:
isKeySupported in class Cipher

isChainingSupported

protected final boolean isChainingSupported(int chaining)
Specified by:
isChainingSupported in class Cipher

isPaddingSupported

protected final boolean isPaddingSupported(int padding)
Specified by:
isPaddingSupported in class Cipher