SHOW Signed SHOW CryptoExtensionAPI

net.rim.device.api.crypto
Class DESCryptoToken

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

public abstract class DESCryptoToken
extends Object
implements SymmetricCryptoToken, Persistable

Represents a DES crypto token.

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.

Details on implementing for smart cards.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

Since:
JDE 3.6.0

Constructor Summary
 Category: Signed Category: CryptoExtensionAPI protected DESCryptoToken()
          Creates a new DESCryptoToken object.
 
Method Summary
 Category: Signed Category: CryptoExtensionAPI  CryptoTokenSymmetricKeyData createKey()
          Creates a new key.
 Category: Signed Category: CryptoExtensionAPI  void decrypt(CryptoTokenCipherContext context, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset)
          Decrypts data given an array of plaintext and a context.
 Category: Signed Category: CryptoExtensionAPI  void deleteKey(CryptoTokenSymmetricKeyData data)
          Delete the specified key on the crypto token.
 Category: Signed Category: CryptoExtensionAPI  void encrypt(CryptoTokenCipherContext context, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset)
          Encrypts data given an array of plaintext and a context.
 Category: Signed Category: CryptoExtensionAPI  byte[] extractKeyData(CryptoTokenSymmetricKeyData data)
          Extracts the key data from the crypto token and returns it in a byte array.
 Category: Signed Category: CryptoExtensionAPI  String getAlgorithm()
          Returns the algorithm supported by this token, ie "DES".
 Category: Signed Category: CryptoExtensionAPI  CryptoTokenCipherContext initializeDecrypt(CryptoTokenSymmetricKeyData data)
          Initializes the crypto token for decryption.
 Category: Signed Category: CryptoExtensionAPI  CryptoTokenCipherContext initializeEncrypt(CryptoTokenSymmetricKeyData data)
          Initializes the crypto token for encryption.
 Category: Signed Category: CryptoExtensionAPI  CryptoTokenSymmetricKeyData injectKey(byte[] key, int offset)
          Inserts the specified key onto the crypto token.
 Category: Signed Category: CryptoExtensionAPI  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

DESCryptoToken

protected DESCryptoToken()
Creates a new DESCryptoToken object.

This constructor is not used.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Method Detail

getAlgorithm

public final String getAlgorithm()
Returns the algorithm supported by this token, ie "DES".

This method will always return the String "DES".

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

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
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

initializeEncrypt

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

Parameters:
data - The symmetric key data used to encrypt the plaintext.
Returns:
The crypto token 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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

encrypt

public void encrypt(CryptoTokenCipherContext context,
                    byte[] plaintext,
                    int plaintextOffset,
                    byte[] ciphertext,
                    int ciphertextOffset)
             throws CryptoTokenException
Encrypts data given an array of plaintext and a context.

Parameters:
context - The cipher context.
plaintext - A byte array containing the plaintext.
plaintextOffset - The offset, or initial position, of the plaintext data within the array.
ciphertext - A byte array containing the ciphertext.
ciphertextOffset - The offset, or initial position, of the ciphertext within the array.
Throws:
CryptoTokenException - Thrown if an error 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 clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

initializeDecrypt

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

Parameters:
data - The symmetric key data used to encrypt the plaintext.
Returns:
The crypto token 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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

decrypt

public void decrypt(CryptoTokenCipherContext context,
                    byte[] ciphertext,
                    int ciphertextOffset,
                    byte[] plaintext,
                    int plaintextOffset)
             throws CryptoTokenException
Decrypts data given an array of plaintext and a context.

Parameters:
context - The cipher context.
ciphertext - A byte array containing the ciphertext.
ciphertextOffset - The offset, or initial position, of the ciphertext within the array.
plaintext - A byte array to contain the plaintext.
plaintextOffset - The offset, or initial position, of the plaintext data within the array.
Throws:
CryptoTokenException - Thrown if an error 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 clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

extractKeyData

public byte[] extractKeyData(CryptoTokenSymmetricKeyData data)
                      throws CryptoTokenException,
                             CryptoUnsupportedOperationException
Extracts the key data from the crypto token and returns it in a byte array.

Parameters:
data - The symmetric key data contained within the 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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

createKey

public CryptoTokenSymmetricKeyData createKey()
                                      throws CryptoTokenException,
                                             CryptoUnsupportedOperationException
Creates a new key.

Returns:
The symmetric key.
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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

injectKey

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

Parameters:
key - A byte array containing the key data to be injected.
offset - The offset, or start position, of the key data within the array.
Returns:
The symmetric 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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.

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:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.


Copyright 1999-2004 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.