SHOW Signed SHOW CryptoExtensionAPI

net.rim.device.api.crypto
Class AbstractPseudoRandomSource

java.lang.Object
  |
  +--net.rim.device.api.crypto.AbstractPseudoRandomSource
Direct Known Subclasses:
ARC4PseudoRandomSource, CTRPseudoRandomSource, FIPS186PseudoRandomSource, OFBPseudoRandomSource, P1363KDF1PseudoRandomSource, PKCS1MGF1PseudoRandomSource, PKCS5KDF1PseudoRandomSource, PKCS5KDF2PseudoRandomSource, RFC2631KDFPseudoRandomSource, SPKMKDFPseudoRandomSource, X942KDFPseudoRandomSource, X963KDFPseudoRandomSource

public abstract class AbstractPseudoRandomSource
extends Object

Provides default helper implementations for PseudoRandomSource.

Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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

Constructor Summary
 Category: CryptoExtensionAPI Category: Signed protected AbstractPseudoRandomSource()
          Creates a new AbstractPseudoRandomSource object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed  void getBytes(byte[] buffer)
          Generates random bytes, filling the given buffer.
 Category: CryptoExtensionAPI Category: Signed  void getBytes(byte[] buffer, int offset, int length)
          Inserts random bytes into the given buffer starting at the specified array offset.
 Category: CryptoExtensionAPI Category: Signed  byte[] getBytes(int length)
          Generates a specified length of random bytes, returning them as a byte array of exactly that size.
 Category: CryptoExtensionAPI Category: Signed  void xorBytes(byte[] buffer)
          Exclusive-OR's random bytes into the given buffer.
 Category: CryptoExtensionAPI Category: Signed abstract  void xorBytes(byte[] buffer, int offset, int length)
          Exclusive-OR's random bytes into the given buffer starting at the specified array offset.
 Category: CryptoExtensionAPI Category: Signed  void xorBytes(byte[] data, int dataOffset, int dataLength, byte[] buffer, int bufferOffset)
          Copies the bytes of the given data into the given buffer, and then exclusive-OR's random bytes into the copy.
 Category: CryptoExtensionAPI Category: Signed  byte[] xorCopy(byte[] data)
          Copies the bytes of the given data into a new buffer, and then exclusive-OR's random bytes into the copy.
 Category: CryptoExtensionAPI Category: Signed  byte[] xorCopy(byte[] data, int offset, int length)
          Copies the bytes of the given data into a new buffer, and then exclusive-OR's random bytes into the copy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPseudoRandomSource

protected AbstractPseudoRandomSource()
Creates a new AbstractPseudoRandomSource object.

This constructor does nothing.

Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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

getBytes

public void getBytes(byte[] buffer)
              throws CryptoTokenException
Generates random bytes, filling the given buffer.

Parameters:
buffer - The byte array to fill with random bytes.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getBytes

public void getBytes(byte[] buffer,
                     int offset,
                     int length)
              throws CryptoTokenException
Inserts random bytes into the given buffer starting at the specified array offset.

Parameters:
buffer - The array to hold the bytes.
offset - The starting offset within the buffer.
length - The number of bytes to get.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getBytes

public byte[] getBytes(int length)
                throws CryptoTokenException
Generates a specified length of random bytes, returning them as a byte array of exactly that size.

Parameters:
length - The number of random bytes to generate.
Returns:
A new byte array containing the random bytes.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

xorBytes

public void xorBytes(byte[] buffer)
              throws CryptoTokenException
Exclusive-OR's random bytes into the given buffer.

Parameters:
buffer - The byte array to be xor'ed with the random bytes.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

xorBytes

public abstract void xorBytes(byte[] buffer,
                              int offset,
                              int length)
                       throws CryptoTokenException
Exclusive-OR's random bytes into the given buffer starting at the specified array offset.

Parameters:
buffer - The byte array to xor the bytes into.
offset - The starting offset within buffer.
length - The number of bytes to xor.
Throws:
CryptoTokenException - Occurs when a problem occurs with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

xorBytes

public void xorBytes(byte[] data,
                     int dataOffset,
                     int dataLength,
                     byte[] buffer,
                     int bufferOffset)
              throws CryptoTokenException
Copies the bytes of the given data into the given buffer, and then exclusive-OR's random bytes into the copy.

Parameters:
data - The array containing the data to xor.
dataOffset - The starting offset, or initial position, of the data within the buffer.
dataLength - The number of bytes to xor.
buffer - The buffer to xor the bytes into.
offset - The starting offset, or initial bit position, of the data within the buffer.
Throws:
IllegalStateException - if the available random bytes are exhausted.
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

xorCopy

public byte[] xorCopy(byte[] data)
               throws CryptoTokenException
Copies the bytes of the given data into a new buffer, and then exclusive-OR's random bytes into the copy.

Parameters:
data - The data to be xor'ed.
Returns:
The xor'ed byte array.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

xorCopy

public byte[] xorCopy(byte[] data,
                      int offset,
                      int length)
               throws CryptoTokenException
Copies the bytes of the given data into a new buffer, and then exclusive-OR's random bytes into the copy.

Parameters:
data - The byte array containing the data to xor.
offset - The starting offset within the buffer.
length - The number of bytes to xor.
Returns:
The xor'ed byte array.
Throws:
CryptoTokenException - Occurs when a problem exists with a crypto token or the crypto token is invalid.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.