|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.AESEncryptorEngine
public final class AESEncryptorEngine
Creates an Advanced Encryption Standard (AES) encryption engine. AES is also known as Rijndael. For more information visit the NIST web page. The implementation of AES we give is defined in FIPS 197.
The AES cipher has a variable key length of 128, 192 or 256 bits. The block length is also variable but defaults to 128 bits. The other valid block lengths are 192 and 256 bits.
For a code sample using the AES encryptor engine, click here.
For information on cryptographic algorithms, see Crypto Algorithms.
AESDecryptorEngine
,
AESKey
Field Summary | ||
---|---|---|
|
static int |
BLOCK_LENGTH_DEFAULT
This is the default block length of a AES key |
Constructor Summary | ||
---|---|---|
|
AESEncryptorEngine(AESKey key)
Creates an instance of the AESEncryptorEngine class given the AES key with a default block length of 16 bytes. |
|
|
AESEncryptorEngine(AESKey key,
int blockLength)
Creates an instance of the AESEncryptorEngine class given the AES key. |
|
|
AESEncryptorEngine(AESKey key,
int blockLength,
boolean inECMMode)
Creates an instance of the AESEncryptorEngine class given the AES key. |
Method Summary | ||
---|---|---|
|
void |
encrypt(byte[] plaintext,
int plaintextOffset,
byte[] ciphertext,
int ciphertextOffset)
Encrypts the data given a byte array containing the plaintext, a byte array to hold the ciphertext, and their associated offsets. |
|
String |
getAlgorithm()
Returns the name of the algorithm with with key and block lengths, ie "AES_128_128" ( "AES_" + keyBitLength + "_" + blockBitLength ). |
|
int |
getBlockLength()
Returns the block length of the encrypted data. |
|
int |
getKeyLength()
Returns the length of the key in bytes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BLOCK_LENGTH_DEFAULT
Constructor Detail |
---|
public AESEncryptorEngine(AESKey key) throws CryptoTokenException, CryptoUnsupportedOperationException
AESEncryptorEngine
class given the AES key with a default block length of 16 bytes.
key
- The AESKey that will be used by the cipher to encrypt data.
CryptoTokenException
- Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to an unsupported operation.public AESEncryptorEngine(AESKey key, int blockLength) throws CryptoTokenException, CryptoUnsupportedOperationException
AESEncryptorEngine
class given the AES key.
key
- The AESKey that will be used by the cipher to encrpyt data.blockLength
- The block length of the cipher in bytes ( the valid lengths are 16, 24 and 32 ).
CryptoTokenException
- Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to an unsupported operation.public AESEncryptorEngine(AESKey key, int blockLength, boolean inECMMode) throws CryptoTokenException, CryptoUnsupportedOperationException
AESEncryptorEngine
class given the AES key.
key
- The AESKey that will be used by the cipher to encrpyt data.blockLength
- The block length of the cipher in bytes ( the valid lengths are 16, 24 and 32 ).inECMMode
- If true, then use a strong, but slow, AES implementation (including many electromagnetic countermeasures); otherwise, use a faster
implementation that is not as strong (including fewer electromagnetic countermeasures).
CryptoTokenException
- Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException
- Thrown if a call is made to an unsupported operation.Method Detail |
---|
public String getAlgorithm()
"AES_" + keyBitLength + "_" + blockBitLength
).
getAlgorithm
in interface BlockEncryptorEngine
public int getKeyLength()
public int getBlockLength()
getBlockLength
in interface BlockEncryptorEngine
public void encrypt(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset) throws CryptoTokenException
encrypt
in interface BlockEncryptorEngine
plaintext
- A byte array containing the plaintext.plaintextOffset
- The offset, or position of the first bit, of the plaintext.ciphertext
- A byte array containing the ciphertext.ciphertextOffset
- The offset, or position of the first bit, of the
ciphertext.
CryptoTokenException
- Thrown when a problem occurs with a crypto token or the crypto token is invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.