SHOW Signed

net.rim.device.api.crypto
Class StreamEncryptor

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--net.rim.device.api.crypto.CryptoOutputStream
              |
              +--net.rim.device.api.crypto.EncryptorOutputStream
                    |
                    +--net.rim.device.api.crypto.StreamEncryptor
Direct Known Subclasses:
CFBEncryptor, ECIESEncryptor, PRNGEncryptor

public abstract class StreamEncryptor
extends EncryptorOutputStream

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.

See Also:
StreamDecryptor

Fields inherited from class net.rim.device.api.crypto.CryptoOutputStream
_out
 
Constructor Summary
 Category: Signed protected StreamEncryptor(OutputStream output)
          Creates a StreamEncryptor object based upon an output stream that will be given the encrypted data.
 
Method Summary
 Category: Signed protected abstract  void encrypt(byte[] plaintext, int plaintextOffset, int length, byte[] ciphertext)
          Encrypts data using the specific implementation of the chosen stream encryptor.
 Category: Signed  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
close, flush, getAlgorithm, getOutputStream, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamEncryptor

protected StreamEncryptor(OutputStream output)
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.
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

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
Description copied from class: CryptoOutputStream
Writes a specified length of bytes from the given byte array to this output stream.

Overrides:
write in class CryptoOutputStream
Since:
JDE 3.6
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.

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


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.