SHOW Signed

net.rim.device.api.crypto
Class PRNGEncryptor

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--net.rim.device.api.crypto.CryptoOutputStream
              |
              +--net.rim.device.api.crypto.EncryptorOutputStream
                    |
                    +--net.rim.device.api.crypto.StreamEncryptor
                          |
                          +--net.rim.device.api.crypto.PRNGEncryptor

public final class PRNGEncryptor
extends StreamEncryptor

Provides the functionality required to use a pseudo-random source to provide a stream cipher. The PRNGEncryptor class takes a pseudo random source and an output stream. Combining these two elements we get a stream cipher that encrypts data and then sends it to the output stream.

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.

Since:
JDE 3.6.0

Fields inherited from class net.rim.device.api.crypto.CryptoOutputStream
_out
 
Constructor Summary
 Category: Signed PRNGEncryptor(PseudoRandomSource keystream, OutputStream output)
          Creates a PRNGEncryptor object given a specified output stream and a keystream will generate numbers to encrypt with.
 
Method Summary
 Category: Signed protected  void encrypt(byte[] plaintext, int plaintextOffset, int plaintextLength, byte[] ciphertext)
          Encrypts data using the specific implementation of the chosen stream encryptor.
 Category: Signed  String getAlgorithm()
          Returns the name of the encryption algorithm used, eg "ARC4".
 
Methods inherited from class net.rim.device.api.crypto.StreamEncryptor
write
 
Methods inherited from class net.rim.device.api.crypto.CryptoOutputStream
close, flush, getOutputStream, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PRNGEncryptor

public PRNGEncryptor(PseudoRandomSource keystream,
                     OutputStream output)
Creates a PRNGEncryptor object given a specified output stream and a keystream will generate numbers to encrypt with.

Parameters:
output - An OutputStream object that will contain the ciphertext after the class has completed its task.
keystream - A PseudoRandomSource object to create random numbers that provide a secure method for encrypting the stream.
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

getAlgorithm

public String getAlgorithm()
Returns the name of the encryption algorithm used, eg "ARC4".

Overrides:
getAlgorithm in class CryptoOutputStream
Returns:
A String that represents the name of the algorithm.
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.

encrypt

protected void encrypt(byte[] plaintext,
                       int plaintextOffset,
                       int plaintextLength,
                       byte[] ciphertext)
                throws CryptoTokenException
Description copied from class: StreamEncryptor
Encrypts data using the specific implementation of the chosen stream encryptor.

Overrides:
encrypt in class StreamEncryptor
Since:
JDE 3.7.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.


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.