net.rim.device.api.crypto
Class StreamDecryptor

java.lang.Object
  extended by java.io.InputStream
      extended by net.rim.device.api.crypto.CryptoInputStream
          extended by net.rim.device.api.crypto.DecryptorInputStream
              extended by net.rim.device.api.crypto.StreamDecryptor
Direct Known Subclasses:
CFBDecryptor, ECIESDecryptor, PRNGDecryptor

public abstract class StreamDecryptor
extends DecryptorInputStream

StreamDecryptor is an abstract class which contains functionality common to all stream decryptors. A stream decryptor is an decryption scheme which decrypts data one byte at a time, instead of in blocks.

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
 
Fields inherited from class net.rim.device.api.crypto.CryptoInputStream
_inputStream
 
Constructor Summary
Category: Signed StreamDecryptor(InputStream input)
          Creates a StreamDecryptor object based on an input stream that contains the encrypted data.
 
Method Summary
Category: Signed protected abstract  void decrypt(byte[] data, int offset, int length)
          Decrypts data according to the specific implementation of the chosen stream cipher.
Category: Signed  int read(byte[] data, int offset, int length)
          Reads up to the specified number of bytes from this input stream into an array of bytes.
 
Methods inherited from class net.rim.device.api.crypto.CryptoInputStream
available, close, getAlgorithm, 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

StreamDecryptor

public StreamDecryptor(InputStream input)
Creates a StreamDecryptor object based on an input stream that contains the encrypted data.

Parameters:
input - The input stream used for reading the encrypted data from.
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


Method Detail

read

public int read(byte[] data,
                int offset,
                int length)
         throws IOException
Description copied from class: CryptoInputStream
Reads up to the specified number of bytes from this input stream into an array of bytes. This method blocks until some input is available.

Specified by:
read in class CryptoInputStream
Parameters:
data - The buffer into which the data is read.
offset - The starting offset within the buffer, to store the data.
length - The maximum number of bytes to read.
Returns:
The total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Throws:
IOException - Thrown if an I/O error occurs.
See Also:
InputStream.read()
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

protected abstract void decrypt(byte[] data,
                                int offset,
                                int length)
                         throws CryptoTokenException
Decrypts data according to the specific implementation of the chosen stream cipher. The data should be decrypted in place.

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