SHOW Signed

net.rim.device.api.crypto
Class PRNGDecryptor

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.rim.device.api.crypto.CryptoInputStream
              |
              +--net.rim.device.api.crypto.DecryptorInputStream
                    |
                    +--net.rim.device.api.crypto.StreamDecryptor
                          |
                          +--net.rim.device.api.crypto.PRNGDecryptor

public final class PRNGDecryptor
extends StreamDecryptor

The PRNGDecryptor is used in conjunction with a PseudoRandomSource to decrypt data provided to this class in a stream interface to the calling class.

A PRNG represents a Pseudo Random Number Generator.

It provides a similar relationship or functionality that the BlockDecryptor uses for BlockDecryptorEngines. That is, it allows you to use a PseudoRandomSource as an input stream instead of relying on the decryption mechanisms exposed in the PseudoRandomSource class.

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
See Also:
PRNGEncryptor

Field Summary
 
Fields inherited from class net.rim.device.api.crypto.CryptoInputStream
_inputStream
 
Constructor Summary
 Category: Signed PRNGDecryptor(PseudoRandomSource keystream, InputStream input)
          Creates a PRNGDecryptor object based on an input stream and a keystream that will create random numbers and decrypt the ciphertext with them.
 
Method Summary
 Category: Signed protected  void decrypt(byte[] data, int offset, int length)
          Decrypts data according to the specific implementation of the chosen stream cipher.
 Category: Signed  String getAlgorithm()
          Returns the name of the encryption algorithm used, eg "ARC4".
 
Methods inherited from class net.rim.device.api.crypto.StreamDecryptor
read
 
Methods inherited from class net.rim.device.api.crypto.CryptoInputStream
available, close, 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

PRNGDecryptor

public PRNGDecryptor(PseudoRandomSource keystream,
                     InputStream input)
Creates a PRNGDecryptor object based on an input stream and a keystream that will create random numbers and decrypt the ciphertext with them.

Parameters:
keystream - A PseudoRandomSource object to recreate the original random numbers in order to decrypt the input stream.
input - An inputstream object containing the plaintext.
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

decrypt

protected void decrypt(byte[] data,
                       int offset,
                       int length)
                throws CryptoTokenException
Description copied from class: StreamDecryptor
Decrypts data according to the specific implementation of the chosen stream cipher. The data should be decrypted in place.

Overrides:
decrypt in class StreamDecryptor
Since:
JDE 3.6.0

Following copied from class: StreamDecryptor
Parameters:
data - A byte array containing the input to the stream cipher.
offset - The offset, or initial position within the array, of the information to decrypt.
length - The length, in bytes, of the information to decrypt.
Throws:
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
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.

getAlgorithm

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

Overrides:
getAlgorithm in class CryptoInputStream
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.


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.