|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.motorola.iden.crypto.CipherSpi | +--com.motorola.iden.provider.AES
The AES algorithm, with PKCS#5 padding.
If the number of bits in the AES key is bitlength,the bitlength should be 128, 192 or 256. Otherwise, an InvalidKeyException will be thrown. Blocksize of AES should be 128 bits. Mode CBC, CFB128 or OFB128 should have IV that as long as 128 bits. Otherwise, an InvalidAlgorithmParameterException should be thrown. MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
[CipherSpi]
Field Summary | |
static int |
blocksize
The blocksize of DES. |
Constructor Summary | |
AES()
AES is not supported in Gemini product.. |
Method Summary | |
protected byte[] |
engineDoFinal(byte[] input,
int inputOffset,
int inputLen)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
protected int |
engineGetBlockSize()
Returns the block size (in bytes). |
protected byte[] |
engineGetIV()
Returns the initialization vector (IV) in a new buffer. |
protected void |
engineInit(int opmode,
Key key,
AlgorithmParameterSpec params,
SecureRandom random)
Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
protected void |
engineSetMode(java.lang.String mode)
Sets the mode of this cipher. |
protected void |
engineSetPadding(java.lang.String padding)
Sets the padding mechanism of this cipher. |
protected byte[] |
engineUpdate(byte[] input,
int inputOffset,
int inputLen)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int blocksize
Constructor Detail |
public AES()
Method Detail |
protected void engineSetMode(java.lang.String mode) throws NoSuchAlgorithmException
engineSetMode
in class CipherSpi
String
- mode - the cipher modeNoSuchAlgorithmException
- if the requested mode mechanism
does not existprotected void engineSetPadding(java.lang.String padding) throws NoSuchPaddingException
engineSetPadding
in class CipherSpi
String
- padding - the padding mechanismNoSuchAlgorithmException
- if the requested mode mechanism
does not existprotected int engineGetBlockSize()
engineGetBlockSize
in class CipherSpi
protected byte[] engineGetIV()
engineGetIV
in class CipherSpi
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
engineInit
in class CipherSpi
opmode
- - the operation mode of this cipher (this is one of the following: ENCRYPT_MODE, DECRYPT_MODE,key
- - the encryption keyparams
- - the algorithm parametersrandom
- - the source of randomnessInvalidKeyException
- - if the given key is inappropriate for initializing
this cipherInvalidAlgorithmParameterException
- - if the given algorithm parameters are inappropriate
for this cipher, or if this cipher is being initialized for decryption and requires
algorithm parameters and params is null.protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen)
engineUpdate
in class CipherSpi
input
- - the input bufferinputOffset
- - the offset in input where the input startsprotected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException
engineDoFinal
in class CipherSpi
input
- - the input bufferinputOffset
- - the offset in input where the input startsIllegalBlockSizeException
- - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the total input length
of the data processed by this cipher is not a multiple of block sizeBadPaddingException
- - if this cipher is in decryption mode,
and (un)padding has been requested, but the decrypted data is not bounded by
the appropriate padding bytes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |