SHOW Signed
 

net.rim.device.api.crypto
Class CFBDecryptor

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.rim.device.api.crypto.CryptoInputStream
              |
              +--net.rim.device.api.crypto.DecryptorInputStream
                    |
                    +--net.rim.device.api.crypto.StreamDecryptor
                          |
                          +--net.rim.device.api.crypto.CFBDecryptor

public final class CFBDecryptor
extends StreamDecryptor

CFBDecryptor is the class used to iterate a given block cipher in 8 or 64-bit Cipher Feedback (CFB) mode. CFB mode is defined in FIPS 81.

Note: CFB mode uses encryption for both the encryption and decryption of the block cipher and hence should only be used with symmetric cryptography and not with asymmetric cryptography.

For a code sample using the CFB decryptor, 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:
InitializationVector, CFBEncryptor

Field Summary
 
Fields inherited from class net.rim.device.api.crypto.CryptoInputStream
_inputStream
 
Constructor Summary
 Category: Signed CFBDecryptor(SymmetricKeyEncryptorEngine engine, InitializationVector iv, InputStream input, boolean eightBitCFB)
          Creates the CFB cipher with the given encryptor engine and initialization vector.
 
Method Summary
 Category: Signed protected  void decrypt(byte[] data, int dataOffset, int dataLength)
          Decrypts data according to the specific implementation of the chosen stream cipher.
 Category: Signed  String getAlgorithm()
          Returns the name of the encryption algorithm used, ie SymmetricKeyEncryptorEngine.getAlgorithm() + "/CFB".
 Category: Signed  InitializationVector getIV()
          Returns the initialization vector.
 
Methods inherited from class net.rim.device.api.crypto.StreamDecryptor
read
 
Methods inherited from class net.rim.device.api.crypto.CryptoInputStream
available, close, getInputStream, markSupported, read, read
 
Methods inherited from class java.io.InputStream
mark, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFBDecryptor

public CFBDecryptor(SymmetricKeyEncryptorEngine engine,
                    InitializationVector iv,
                    InputStream input,
                    boolean eightBitCFB)
Creates the CFB cipher with the given encryptor engine and initialization vector. It is imperative that the initialization vector is always unique for each key used or a cryptanalyst can retrieve the plaintext.

Parameters:
engine - The SymmetricKeyEncryptorEngine object to use for decryption.
iv - The initialization vector. This must have the same length as the block length of the engine.
input - The underlying InputStream object used to read in data for decryption.
eightBitCFB - A boolean to indicate the amount of cipher feedback. If set, then 8 bits of cipher feedback are used, otherwise, the encryptor engine's block size determines the amount of cipher feedback.
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

decrypt

protected void decrypt(byte[] data,
                       int dataOffset,
                       int dataLength)
                throws CryptoTokenException
Description copied from class: StreamDecryptor
Decrypts data according to the specific implementation of the chosen stream cipher. The data should be decrypted in place.

Overrides:
decrypt in class StreamDecryptor
Since:
JDE 3.6.0

Following copied from class: StreamDecryptor
Parameters:
data - A byte array containing the input to the stream cipher.
offset - The offset, or initial position within the array, of the information to decrypt.
length - The length, in bytes, of the information to decrypt.
Throws:
CryptoTokenException - Thrown when an error occurs with the 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.

getAlgorithm

public String getAlgorithm()
Returns the name of the encryption algorithm used, ie SymmetricKeyEncryptorEngine.getAlgorithm() + "/CFB".

Overrides:
getAlgorithm in class CryptoInputStream
Returns:
The name of the 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.

getIV

public InitializationVector getIV()
Returns the initialization vector.

Returns:
The initialization vector.
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.