SHOW Signed SHOW CryptoExtensionAPI
 

net.rim.device.api.crypto
Class AESCryptoToken

java.lang.Object
  |
  +--net.rim.device.api.crypto.AESCryptoToken
All Implemented Interfaces:
CryptoToken, Persistable, Persistable, SymmetricCryptoToken

public abstract class AESCryptoToken
extends Object
implements SymmetricCryptoToken, Persistable

Represents an Advanced Encryption System (AES) crypto token. For more information visit the NIST web page.

Note: This class must be extended in order to override the default implementation.

Note: It is considered good practice to implement the equals and hashCode methods when extending this class. Otherwise, odd behaviour can occur.

(@link AESKey More information on the AES key.) Details on implementing for smart cards.

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.

Since:
JDE 3.6.0

Constructor Summary
 Category: CryptoExtensionAPI Category: Signed protected AESCryptoToken()
          Creates a new AESCryptoToken object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenSymmetricKeyData createKey(int bitLength)
          Create a key for the crypto token.
 Category: CryptoExtensionAPI Category: Signed  void decrypt(CryptoTokenCipherContext context, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset)
          Decrypts an array of ciphertext using the crypto token.
 Category: CryptoExtensionAPI Category: Signed  void deleteKey(CryptoTokenSymmetricKeyData data)
          Delete the specified key on the crypto token.
 Category: CryptoExtensionAPI Category: Signed  void encrypt(CryptoTokenCipherContext context, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset)
          Encrypts an array of plaintext using the crypto token.
 Category: CryptoExtensionAPI Category: Signed  byte[] extractKeyData(CryptoTokenSymmetricKeyData data)
          Returns the key data contained in the crypto token.
 Category: CryptoExtensionAPI Category: Signed  int extractKeyDataLength(CryptoTokenSymmetricKeyData data)
          Returns the key data length.
 Category: CryptoExtensionAPI Category: Signed  String getAlgorithm()
          Returns the algorithm supported by this token, ie "AES".
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenCipherContext initializeDecrypt(CryptoTokenSymmetricKeyData data, int blockLength)
          Initializes the token for decryption.
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenCipherContext initializeDecrypt(CryptoTokenSymmetricKeyData data, int blockLength, boolean isInECMMode)
          Initializes the token for decryption.
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenCipherContext initializeEncrypt(CryptoTokenSymmetricKeyData data, int blockLength)
          Initializes the token for encryption.
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenCipherContext initializeEncrypt(CryptoTokenSymmetricKeyData data, int blockLength, boolean isInECMMode)
          Initializes the token for encryption.
 Category: CryptoExtensionAPI Category: Signed  CryptoTokenSymmetricKeyData injectKey(byte[] key, int offset, int bitLength)
          Inserts the key onto the crypto token.
 Category: CryptoExtensionAPI Category: Signed  boolean providesUserAuthentication()
          Returns true if the token provides its own user authentication checks, eg a smartcard will prompt for a password before allowing access to the keys.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AESCryptoToken

protected AESCryptoToken()
Creates a new AESCryptoToken object.

This constructor is not used.

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.
Method Detail

createKey

public CryptoTokenSymmetricKeyData createKey(int bitLength)
                                      throws CryptoTokenException,
                                             CryptoUnsupportedOperationException
Create a key for the crypto token.

Parameters:
bitLength - An integer representing the length of the key in bits.
Returns:
The key data.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

decrypt

public void decrypt(CryptoTokenCipherContext context,
                    byte[] ciphertext,
                    int ciphertextOffset,
                    byte[] plaintext,
                    int plaintextOffset)
             throws CryptoTokenException
Decrypts an array of ciphertext using the crypto token.

Parameters:
context - The crypto token context.
ciphertext - An array containing the ciphertext to decrypt.
ciphertextOffset - The offset, or starting bit, of the ciphertext data within the array.
plaintext - An array to contain the plaintext.
plaintextOffset - The offset, or start position, of the plaintext data within the array.
Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
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.

deleteKey

public void deleteKey(CryptoTokenSymmetricKeyData data)
               throws CryptoTokenException,
                      CryptoUnsupportedOperationException
Delete the specified key on the crypto token.

Parameters:
data - The symmetric key data contained within the token.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

encrypt

public void encrypt(CryptoTokenCipherContext context,
                    byte[] plaintext,
                    int plaintextOffset,
                    byte[] ciphertext,
                    int ciphertextOffset)
             throws CryptoTokenException
Encrypts an array of plaintext using the crypto token.

Parameters:
context - The crypto token context.
plaintext - An array containing the plaintext to be encrypted.
plaintextOffset - The offset, or start position, of the plaintext data within the array.
ciphertext - An array to contain the ciphertext.
ciphertextOffset - The offset, or starting bit, of the new cipher text data within the array.
Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
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.

extractKeyData

public byte[] extractKeyData(CryptoTokenSymmetricKeyData data)
                      throws CryptoTokenException,
                             CryptoUnsupportedOperationException
Returns the key data contained in the crypto token.

Parameters:
data - The symmetric data contained on the crypto token.
Returns:
A byte array containing the key data.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

extractKeyDataLength

public int extractKeyDataLength(CryptoTokenSymmetricKeyData data)
                         throws CryptoTokenException,
                                CryptoUnsupportedOperationException
Returns the key data length.

Parameters:
data - The symmetric key data.
Returns:
An integer representing the key length.
Throws:
CryptoTokenException - Thrown if an error 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:
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 final String getAlgorithm()
Returns the algorithm supported by this token, ie "AES".
Since:
JDE 3.6.0

Following copied from interface: CryptoToken
Returns:
A String that represents the name of the algorithm.
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.

initializeDecrypt

public CryptoTokenCipherContext initializeDecrypt(CryptoTokenSymmetricKeyData data,
                                                  int blockLength)
                                           throws CryptoTokenException,
                                                  CryptoUnsupportedOperationException
Initializes the token for decryption.

Parameters:
data - The symmetric key data contained on the crypto token.
blockLength - The block length of the decryption cipher.
Returns:
The cipher context.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

initializeDecrypt

public CryptoTokenCipherContext initializeDecrypt(CryptoTokenSymmetricKeyData data,
                                                  int blockLength,
                                                  boolean isInECMMode)
                                           throws CryptoTokenException,
                                                  CryptoUnsupportedOperationException
Initializes the token for decryption.

Parameters:
data - The symmetric key data contained on the crypto token.
blockLength - The block length of the decryption cipher.
isInECMMode - indicates whether device is in strong AES-Electromagnetic Countermeasures mode
Returns:
The cipher context.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

initializeEncrypt

public CryptoTokenCipherContext initializeEncrypt(CryptoTokenSymmetricKeyData data,
                                                  int blockLength)
                                           throws CryptoTokenException,
                                                  CryptoUnsupportedOperationException
Initializes the token for encryption.

Parameters:
data - The symmetric key data contained on the crypto token.
blockLength - The block length of the encryption cipher.
Returns:
The cipher context.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

initializeEncrypt

public CryptoTokenCipherContext initializeEncrypt(CryptoTokenSymmetricKeyData data,
                                                  int blockLength,
                                                  boolean isInECMMode)
                                           throws CryptoTokenException,
                                                  CryptoUnsupportedOperationException
Initializes the token for encryption.

Parameters:
data - The symmetric key data contained on the crypto token.
blockLength - The block length of the encryption cipher.
isInECMMode - indicates whether device is in strong AES-Electromagnetic Countermeasures mode
Returns:
The cipher context.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

injectKey

public CryptoTokenSymmetricKeyData injectKey(byte[] key,
                                             int offset,
                                             int bitLength)
                                      throws CryptoTokenException,
                                             CryptoUnsupportedOperationException
Inserts the key onto the crypto token.

Parameters:
key - A byte array containing the key.
offset - The offset, or start position, of the key data within the array.
bitLength - The length of the key in bits.
Returns:
The key data.
Throws:
CryptoTokenException - Thrown if an error 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:
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.

providesUserAuthentication

public boolean providesUserAuthentication()
Returns true if the token provides its own user authentication checks, eg a smartcard will prompt for a password before allowing access to the keys. This default implementation returns false.
Since:
JDE 3.6.0

Following copied from interface: CryptoToken
Returns:
true if the user will be authenticated by the token itself.
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.



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.