|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
net.rim.device.api.crypto.CryptoInputStream
net.rim.device.api.crypto.DecryptorInputStream
net.rim.device.api.crypto.BlockDecryptor
public class BlockDecryptor
The superclass of all classes that implement block ciphers. The block ciphers sit on the Decryptor input stream and any data that is written to the input stream is acted on by the Block cipher. The class BlockCipherDecryptor itself simply overrides many of the methods defined for the Decryptor class with methods that are specific to block ciphers.
It is important to note that the default mode for all block ciphers is Electronic Code Book mode (ECB) where each block is encrypted/decrypted separately and independently from all other blocks.
Note: For the block cipher algorithm classes, each block is decrypted one block at a time.
BlockEncryptor| Field Summary |
|---|
| Fields inherited from class net.rim.device.api.crypto.CryptoInputStream |
|---|
_inputStream |
| Constructor Summary | ||
|---|---|---|
|
BlockDecryptor(BlockDecryptorEngine decryptorEngine,
InputStream in)
Creates a BlockDecryptor object based on the given block decryptor and input stream. |
|
|
BlockDecryptor(BlockUnformatterEngine unformatterEngine,
InputStream in)
Creates a BlockDecryptor object using a given unformatter engine and input stream. |
|
| Method Summary | ||
|---|---|---|
|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
|
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
|
String |
getAlgorithm()
Returns the name of the algorithm or both the algorithm and unformatter engine used, depending what BlockDecryptor constructor was used. |
|
int |
getInputBlockLength()
Returns the input block length of the cipher in bytes. |
|
int |
getOutputBlockLength()
Returns the output block length of the cipher in bytes. |
|
int |
read(byte[] buffer,
int bufferOffset,
int bufferLength)
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 |
|---|
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 |
|---|
public BlockDecryptor(BlockUnformatterEngine unformatterEngine,
InputStream in)
BlockDecryptor object using a given unformatter engine and input stream.
unformatterEngine - An instance of the unformatter engine to use
to decode the incoming data.in - The input stream that the data will be read from.
public BlockDecryptor(BlockDecryptorEngine decryptorEngine,
InputStream in)
BlockDecryptor object based on the given block decryptor and input stream.
decryptorEngine - An instance of the decryptor engine to use
to decrypt the incoming data.in - The input stream that the data will be read from.| Method Detail |
|---|
public String getAlgorithm()
getAlgorithm in class CryptoInputStreampublic int getInputBlockLength()
public int getOutputBlockLength()
public int read(byte[] buffer,
int bufferOffset,
int bufferLength)
throws IOException
CryptoInputStream
read in class CryptoInputStreambuffer - The buffer into which the data is read.bufferOffset - The starting offset within the buffer, to store the data.bufferLength - The maximum number of bytes to read.
IOException - Thrown if an I/O error occurs.InputStream.read()
public int available()
throws IOException
Note that in this case, of a block decryptor, the value returned by available is an underestimate of the data available since there may be padding bytes that could be stripped from the data in a read call. So the amount of data actually available may be a larger than indicated by a call to this available function.
available in class CryptoInputStreamIOException - If an I/O error occurs.
public void close()
throws IOException
CryptoInputStream
close in class CryptoInputStreamIOException - Thrown if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.