SHOW Signed SHOW CryptoExtensionAPI
 

net.rim.device.api.crypto
Class AESKey

java.lang.Object
  |
  +--net.rim.device.api.crypto.AESKey
All Implemented Interfaces:
Key, Persistable, Persistable, SymmetricKey

public final class AESKey
extends Object
implements SymmetricKey, Persistable

Creates an Advanced Encryption Standard (AES) key. AES is also known as Rijndael. For more information visit the NIST web page.

The AES cipher has a variable block length of 128, 192, or 256 bits. It also has a variable key length of 128, 192 or 256 bits. The lengths can be varied independently, resulting in nine possible combinations.

For information on cryptographic algorithms, see Crypto Algorithms.

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

Constructor Summary
 Category: Signed AESKey()
          Creates a new random 128-bit key.
 Category: CryptoExtensionAPI Category: Signed AESKey(AESCryptoToken cryptoToken, byte[] data, int offset, int bitLength)
          Creates a key using existing data.
 Category: CryptoExtensionAPI Category: Signed AESKey(AESCryptoToken cryptoToken, CryptoTokenSymmetricKeyData cryptoTokenData)
          Creates a key using existing data.
 Category: Signed AESKey(byte[] data)
          Creates the longest key possible from existing data.
 Category: Signed AESKey(byte[] data, int offset)
          Creates the longest key possible from existing data.
 Category: Signed AESKey(byte[] data, int offset, int bitLength)
          Creates a key using existing data.
 Category: Signed AESKey(int bitLength)
          Creates a new random key of 128, 192, or 256 bits.
 
Method Summary
 Category: Signed  boolean equals(Object obj)
          Returns a boolean that indicates if the specified key and the current key are equal.
 Category: CryptoExtensionAPI Category: Signed  AESCryptoToken getAESCryptoToken()
          Returns the crypto token.
 Category: Signed  String getAlgorithm()
          Returns a string containing the name of the algorithm associated with this key ("AES").
 Category: Signed  int getBitLength()
          Returns the number of bits that make up the actual keying material ( for example parity bits are not counted ).
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenSymmetricKeyData getCryptoTokenData()
          Returns the symmetric crypto token data.
 Category: Signed  byte[] getData()
          Returns the key data.
 Category: Signed  int getLength()
          Returns the length of the key.
 Category: CryptoExtensionAPI Category: Signed  SymmetricCryptoToken getSymmetricCryptoToken()
          Returns the crypto token associated with this key.
 Category: Signed  int hashCode()
          Returns the hash code of the crypto token.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AESKey

public AESKey()
Creates a new random 128-bit key.
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.

AESKey

public AESKey(AESCryptoToken cryptoToken,
              byte[] data,
              int offset,
              int bitLength)
       throws CryptoTokenException,
              CryptoUnsupportedOperationException
Creates a key using existing data.

Parameters:
cryptoToken - The crypto token.
data - The bytes used to create the key.
offset - The offset, or position of the first bit, of the key data.
bitLength - The length of the key, in bits (128, 192, or 256).
Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

AESKey

public AESKey(AESCryptoToken cryptoToken,
              CryptoTokenSymmetricKeyData cryptoTokenData)
       throws CryptoTokenException,
              CryptoUnsupportedOperationException
Creates a key using existing data.

Parameters:
cryptoToken - The crypto token.
cryptoTokenData - The data contained on the crypto token.
Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

AESKey

public AESKey(byte[] data)
Creates the longest key possible from existing data.

Parameters:
data - The bytes used to create the key (the first 128 bits of the array are used).
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.

AESKey

public AESKey(byte[] data,
              int offset)
Creates the longest key possible from existing data.

Parameters:
data - The bytes used to create the key.
offset - The offset, or position of the first bit, of the key data.
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.

AESKey

public AESKey(byte[] data,
              int offset,
              int bitLength)
Creates a key using existing data.

Parameters:
data - The bytes used to create the key.
offset - The offset, or position of the first bit, of the key data.
bitLength - The length of the key, in bits (128, 192, or 256).
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.

AESKey

public AESKey(int bitLength)
Creates a new random key of 128, 192, or 256 bits.

Parameters:
bitLength - The length of the key in bits (must be 128, 192, or 256).
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.
Method Detail

equals

public boolean equals(Object obj)
Returns a boolean that indicates if the specified key and the current key are equal.

Overrides:
equals in class Object
Parameters:
obj - The AES key.
Returns:
True if the keys are egual, False otherwise.
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.

getAESCryptoToken

public AESCryptoToken getAESCryptoToken()
Returns the crypto token.

Returns:
An AESCryptoToken object representing the crypto token.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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 a string containing the name of the algorithm associated with this key ("AES"). This method will always return the string "AES".

Returns:
A string representing the name of the algorithm used to encrypt and decrypt the data.
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.

getBitLength

public int getBitLength()
                 throws CryptoTokenException,
                        CryptoUnsupportedOperationException
Description copied from interface: SymmetricKey
Returns the number of bits that make up the actual keying material ( for example parity bits are not counted ).

Since:
JDE 3.6.0

Following copied from interface: SymmetricKey
Returns:
An integer that represents the number of bits in the key.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when 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.

getCryptoTokenData

public CryptoTokenSymmetricKeyData getCryptoTokenData()
Returns the symmetric crypto token data.

Returns:
The crypto token data.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getData

public byte[] getData()
               throws CryptoTokenException,
                      CryptoUnsupportedOperationException
Returns the key data.

Returns an array containing the numerical representation of the key.

Returns:
A byte array containing the key 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.

getLength

public int getLength()
              throws CryptoTokenException,
                     CryptoUnsupportedOperationException
Returns the length of the key.

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

getSymmetricCryptoToken

public SymmetricCryptoToken getSymmetricCryptoToken()
Returns the crypto token associated with this key.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

hashCode

public int hashCode()
Returns the hash code of the crypto token.

Overrides:
hashCode in class Object
Returns:
An integer representing the hashcode of the crypto token.
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.