|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--net.rim.device.api.crypto.CryptoOutputStream
|
+--net.rim.device.api.crypto.EncryptorOutputStream
|
+--net.rim.device.api.crypto.BlockEncryptor
The superclass of all classes that implement block ciphers. The block ciphers sit on the Encryptor output stream and any data that is written to the output stream is acted on by the Block cipher. The class BlockEncryptor itself simply overrides many of the methods defined for the Encryptor 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 encrypted one block at a time.
| Fields inherited from class net.rim.device.api.crypto.CryptoOutputStream |
_out |
| Constructor Summary | ||
|
BlockEncryptor(BlockEncryptorEngine encryptorEngine,
OutputStream out)
Creates a BlockEncryptor object using the specified block encryptor engine and output stream. |
|
|
BlockEncryptor(BlockFormatterEngine formatterEngine,
OutputStream out)
Creates a BlockEncryptor object using the specified block encoder and output stream. |
|
| Method Summary | ||
|
void |
close()
Closes the output stream. |
|
void |
flush()
Flushes out the remainder of the data in the output stream. |
|
String |
getAlgorithm()
Returns the name of the algorithm or both the algorithm and formatter engine used, depending what BlockEncryptor 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. |
|
protected void |
pad()
Pads the output properly. |
|
void |
write(byte[] data,
int offset,
int length)
Writes a specified length of bytes from the given byte array to this output stream. |
| Methods inherited from class net.rim.device.api.crypto.CryptoOutputStream |
getOutputStream, write, write |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BlockEncryptor(BlockFormatterEngine formatterEngine, OutputStream out)
formatterEngine - The formatter engine that will be
used to encode the data.out - The output stream that the data will be written to.public BlockEncryptor(BlockEncryptorEngine encryptorEngine, OutputStream out)
encryptorEngine - The encryptor engine that will be
used to encrypt the data.out - The output stream that the data will be written to.| Method Detail |
public String getAlgorithm()
getAlgorithm in class CryptoOutputStreampublic int getInputBlockLength()
public int getOutputBlockLength()
public void write(byte[] data,
int offset,
int length)
throws IOException
CryptoOutputStreamwrite in class CryptoOutputStream
public void flush()
throws IOException
CryptoOutputStreamflush in class CryptoOutputStreamnet.rim.device.api.crypto.CryptoOutputStreamIOException - Thrown if an I/O error occurs.
protected void pad()
throws IOException
IOException - Thrown if an I/O error occurs.
public void close()
throws IOException
CryptoOutputStreamBefore closing the stream, it flushes out all of the data that is in the output stream.
See the flush() method for more information.
close in class CryptoOutputStreamnet.rim.device.api.crypto.CryptoOutputStreamIOException - Thrown if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.