SHOW Signed
 

net.rim.device.api.crypto
Class AESDecryptorEngine

java.lang.Object
  |
  +--net.rim.device.api.crypto.AESDecryptorEngine
All Implemented Interfaces:
BlockDecryptorEngine, SymmetricKeyDecryptorEngine

public final class AESDecryptorEngine
extends Object
implements SymmetricKeyDecryptorEngine

Creates an Advanced Encryption Standard (AES) decryption 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 decryptor engine, click here.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0
See Also:
AESEncryptorEngine, AESKey

Field Summary
 Category: Signed static int BLOCK_LENGTH_DEFAULT
          This is the default block length of a AES key
 
Constructor Summary
 Category: Signed AESDecryptorEngine(AESKey key)
          Creates an instance of the AESDecryptorEngine class given the AES key with a default block length of 16 bytes.
 Category: Signed AESDecryptorEngine(AESKey key, int blockLength)
          Creates an instance of the AESDecryptorEngine class given the AES key.
 Category: Signed AESDecryptorEngine(AESKey key, int blockLength, boolean inECMMode)
          Creates an instance of the AESDecryptorEngine class given the AES key.
 
Method Summary
 Category: Signed  void decrypt(byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset)
          Decrypts the data given a byte array containing the ciphertext, a byte array to hold the plaintext, and their associated offsets.
 Category: Signed  String getAlgorithm()
          Returns the name of the algorithm along with key and block lengths, eg "AES_128_128" ("AES_" + keyBitLength + "_" + blockBitLength).
 Category: Signed  int getBlockLength()
          Returns the block length that the engine uses when Decrypting data.
 Category: Signed  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

BLOCK_LENGTH_DEFAULT

public static final int BLOCK_LENGTH_DEFAULT
This is the default block length of a AES key
Since:
JDE 4.3.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Constructor Detail

AESDecryptorEngine

public AESDecryptorEngine(AESKey key)
                   throws CryptoTokenException,
                          CryptoUnsupportedOperationException
Creates an instance of the AESDecryptorEngine class given the AES key with a default block length of 16 bytes.

Parameters:
key - The AESKey that will be used by the cipher to decrypt data.
Throws:
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

AESDecryptorEngine

public AESDecryptorEngine(AESKey key,
                          int blockLength)
                   throws CryptoTokenException,
                          CryptoUnsupportedOperationException
Creates an instance of the AESDecryptorEngine class given the AES key.

Parameters:
key - The AESKey that will be used by the cipher to decrypt data.
blockLength - The block length of the cipher in bytes ( the valid lengths are 16, 24 and 32 ).
Throws:
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

AESDecryptorEngine

public AESDecryptorEngine(AESKey key,
                          int blockLength,
                          boolean inECMMode)
                   throws CryptoTokenException,
                          CryptoUnsupportedOperationException
Creates an instance of the AESDecryptorEngine class given the AES key.

Parameters:
key - The AESKey that will be used by the cipher to decrypt data.
blockLength - The block length of the cipher in bytes ( the valid lengths are 16, 24 and 32 ).
inECMMode - indicates whether strong AES-Electromagnetic Countermeasures are on
Throws:
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.
Since:
JDE 4.3.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

decrypt

public void decrypt(byte[] ciphertext,
                    int ciphertextOffset,
                    byte[] plaintext,
                    int plaintextOffset)
             throws CryptoTokenException
Decrypts the data given a byte array containing the ciphertext, a byte array to hold the plaintext, and their associated offsets.

Parameters:
ciphertext - The byte array that contains the ciphertext.
ciphertextOffset - The offset, or position of the first bit, of the data.
plaintext - The byte array that contains the plaintext.
plaintextOffset - The offset, or position of the first bit, of the plaintext.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getAlgorithm

public String getAlgorithm()
Returns the name of the algorithm along with key and block lengths, eg "AES_128_128" ("AES_" + keyBitLength + "_" + blockBitLength).

Returns:
A string representing the name of the decryption algorithm.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getBlockLength

public int getBlockLength()
Returns the block length that the engine uses when Decrypting data.

Returns:
An integer representing the block length in bytes.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getKeyLength

public int getKeyLength()
Returns the length of the key in bytes.

Returns:
An integer representing the length of the key in bytes.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.