SHOW Signed

net.rim.device.api.crypto
Class PKCS5KDF1PseudoRandomSource

java.lang.Object
  |
  +--net.rim.device.api.crypto.AbstractPseudoRandomSource
        |
        +--net.rim.device.api.crypto.PKCS5KDF1PseudoRandomSource
All Implemented Interfaces:
PseudoRandomSource

public final class PKCS5KDF1PseudoRandomSource
extends AbstractPseudoRandomSource
implements PseudoRandomSource

Provides PKCS #5 Key Derivation Function 1 pseudo random number generation. This is provided for compatibility with existing applications and is not recommended for new applications due to its limited output length. The output length of this KDF is determined by the output length of the supplied digest.

We implemented the PKCS5 KDF1 as per PKCS #5 version 2.0 ( March 1999 ).

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:
PKCS5KDF2PseudoRandomSource

Constructor Summary
 Category: Signed PKCS5KDF1PseudoRandomSource(byte[] password, byte[] salt, int iterationCount)
          Creates a PKCS5KDF1PseudoRandomSource object using the specified parameters and a SHA-1 digest.
 Category: Signed PKCS5KDF1PseudoRandomSource(byte[] password, int offset, int length, byte[] salt, int iterationCount)
          Creates a PKCS5KDF1PseudoRandomSource object using the supplied parameters and a SHA-1 digest.
 Category: Signed PKCS5KDF1PseudoRandomSource(byte[] password, int offset, int length, byte[] salt, int iterationCount, Digest digest)
          Creates a PKCS5KDF1PseudoRandomSource object using the supplied parameters and the specified digest.
 
Method Summary
 Category: Signed  String getAlgorithm()
          Returns the name of this PseaudoRandomSource "PKCS5KDF1" This method will always return the String "PKCS5KDF1".
 Category: Signed  int getAvailable()
          Returns the number of pseudo random bytes currently available.
 Category: Signed  int getMaxAvailable()
          Returns the maximum number of pseudo random bytes that this PRNG can produce.
 Category: Signed  void xorBytes(byte[] buffer, int offset, int length)
          Exclusive-OR's (xor) random bytes into the given buffer starting at the specified array offset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.crypto.PseudoRandomSource
getBytes, getBytes, getBytes, xorBytes, xorBytes, xorCopy, xorCopy
 

Constructor Detail

PKCS5KDF1PseudoRandomSource

public PKCS5KDF1PseudoRandomSource(byte[] password,
                                   byte[] salt,
                                   int iterationCount)
Creates a PKCS5KDF1PseudoRandomSource object using the specified parameters and a SHA-1 digest.

Parameters:
password - The password to use.
salt - The salt data that is hashed to generate the key data.
iterationCount - The number of times to hash the password and salt.
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.

PKCS5KDF1PseudoRandomSource

public PKCS5KDF1PseudoRandomSource(byte[] password,
                                   int offset,
                                   int length,
                                   byte[] salt,
                                   int iterationCount)
Creates a PKCS5KDF1PseudoRandomSource object using the supplied parameters and a SHA-1 digest.

Parameters:
password - The password to use.
offset - The offset, or starting position, of the password data within the array.
length - The number of bytes to use as password data.
salt - The salt data that is hashed to generate the key data.
iterationCount - The number of times to hash the password and salt.
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.

PKCS5KDF1PseudoRandomSource

public PKCS5KDF1PseudoRandomSource(byte[] password,
                                   int offset,
                                   int length,
                                   byte[] salt,
                                   int iterationCount,
                                   Digest digest)
Creates a PKCS5KDF1PseudoRandomSource object using the supplied parameters and the specified digest.

Parameters:
password - The password to use.
offset - The offset, or starting position, of the password data within the array.
length - The number of bytes to use as password data.
salt - The salt data that is hashed to generate the key data. It is recommended that the salt is 8 bytes or more in length for security.
iterationCount - The number of times to hash the password and salt.
digest - The digest to use for hashing.
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 this PseaudoRandomSource "PKCS5KDF1"

This method will always return the String "PKCS5KDF1".

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.

xorBytes

public void xorBytes(byte[] buffer,
                     int offset,
                     int length)
Description copied from interface: PseudoRandomSource
Exclusive-OR's (xor) random bytes into the given buffer starting at the specified array offset.

Since:
JDE 4.0.2
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.

getMaxAvailable

public int getMaxAvailable()
Description copied from interface: PseudoRandomSource
Returns the maximum number of pseudo random bytes that this PRNG can produce.

For PRNG sources that have an indefinite length but implement this interface, the value returned is Integer.MAX.

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.

getAvailable

public int getAvailable()
Description copied from interface: PseudoRandomSource
Returns the number of pseudo random bytes currently available.

For PRNG sources that have an indefinite length but implement this interface, the value returned is Integer.MAX.

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