net.rim.device.api.crypto
Class AESDecryptorEngine

java.lang.Object
  extended by 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.

See Also:
AESEncryptorEngine, AESKey
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:
BlackBerry API 3.6.0

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 useCPAProtection)
          Creates an instance of the AESDecryptorEngine class given the AES key.
Category: Signed AESDecryptorEngine(AESKey key, int blockLength, boolean useCPAProtection, boolean useFIPSMode)
          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.

See Also:
Constant Field Values
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:
BlackBerry API 4.3.0


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.
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0

AESDecryptorEngine

public AESDecryptorEngine(AESKey key,
                          int blockLength,
                          boolean useCPAProtection)
                   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 ).
useCPAProtection - If true, enable cryptographic power analysis(CPA) protection and use a strong, but slow, AES implementation (including many electromagnetic countermeasures); otherwise, use the fastest version available on the deveice.
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.
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:
BlackBerry API 4.3.0

AESDecryptorEngine

public AESDecryptorEngine(AESKey key,
                          int blockLength,
                          boolean useCPAProtection,
                          boolean useFIPSMode)
                   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 ).
useCPAProtection - If true, enable cryptographic power analysis(CPA) protection and use a strong, but slow, AES implementation (including many electromagnetic countermeasures); otherwise, use the fastest version available on the deveice.
useFIPSMode - If true, then use a FIPS-validated version of AES implementation; otherwise, use the fastest version available on the device.
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.
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:
BlackBerry API 7.0.0


Method Detail

getAlgorithm

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

Specified by:
getAlgorithm in interface BlockDecryptorEngine
Returns:
A string representing the name of the decryption algorithm.
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:
BlackBerry API 3.6.0

getKeyLength

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

Returns:
An integer representing the length of the key in bytes.
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:
BlackBerry API 3.6.0

getBlockLength

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

Specified by:
getBlockLength in interface BlockDecryptorEngine
Returns:
An integer representing the block length in bytes.
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:
BlackBerry API 3.6.0

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.

Specified by:
decrypt in interface BlockDecryptorEngine
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.
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:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal