StreamEncryptor is an abstract class which contains functionality
common to all stream ciphers. A stream encryptor is an encryption
scheme which encrypts data one byte at a time, instead of in blocks.
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.
StreamEncryptor(OutputStream output)
Creates a StreamEncryptor object based upon an output stream that will be given
the encrypted data.
Method Summary
protected abstract void
encrypt(byte[] plaintext,
int plaintextOffset,
int length,
byte[] ciphertext)
Encrypts data using the specific implementation of the chosen stream encryptor.
void
flush(boolean pad)
Flushes any pending data to the stream and, optionally, does any necessary padding correctly.
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
Creates a StreamEncryptor object based upon an output stream that will be given
the encrypted data.
Parameters:
output - An output stream used for writing the transformed data to.
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.
Method Detail
encrypt
protected abstract void encrypt(byte[] plaintext,
int plaintextOffset,
int length,
byte[] ciphertext)
throws CryptoTokenException
Encrypts data using the specific implementation of the chosen stream encryptor.
Parameters:
plaintext - A byte array containing the input to the stream cipher.
plaintextOffset - The offset, or initial position within the array, of the information to encrypt.
length - The length of the information to encrypt.
ciphertext - A byte array to hold the output of the stream cipher.
Throws:
CryptoTokenException - Thrown when a problem occurs with the 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.
Flushes any pending data to the stream and, optionally, does any necessary padding correctly. A subclass should
override this function if they have padding they need done.
This function is useful if you wish to re-use this object and so require that the previously written
data have any necessary padding completed for it.
pad - If true, then perform the appropriate padding code ( if necessary - stream ciphers don't require this )
Otherwise, just flush normally.
Since:
JDE 4.0.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.
write
public void write(byte[] data,
int offset,
int length)
throws IOException
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.
Copyright 1999-2007 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.