net.rim.device.api.crypto
Class AESCTRDRBGPseudoRandomSource

java.lang.Object
  extended by net.rim.device.api.crypto.AbstractPseudoRandomSource
      extended by net.rim.device.api.crypto.AESCTRDRBGPseudoRandomSource
All Implemented Interfaces:
PseudoRandomSource

public final class AESCTRDRBGPseudoRandomSource
extends AbstractPseudoRandomSource
implements PseudoRandomSource

An implementation of a Deterministic Random Bit Generator (DRBG) using an approved AES block cipher algorithm in counter mode. This DRBG uses a 128 bit security strength.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

Constructor Summary
Category: Signed AESCTRDRBGPseudoRandomSource(byte[] seed)
          Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key.
Category: Signed AESCTRDRBGPseudoRandomSource(byte[] seed, byte[] additionalSeed)
          Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key and the additional seed.
Category: Signed AESCTRDRBGPseudoRandomSource(byte[] seed, int offset, int length)
          Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key.
Category: Signed AESCTRDRBGPseudoRandomSource(byte[] seed, int offset, int length, byte[] additionalSeed, int additionalSeedOffset, int additionalSeedLength)
          Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key and the additional seed.
 
Method Summary
Category: Signed  String getAlgorithm()
          Returns the name of this algorithm, "AES CTR DRBG".
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 DRBG can produce.
Category: Signed  void xorBytes(byte[] buffer, int offset, int length)
          Exclusive-OR's (xor) random bytes into the specified buffer starting at the specified array offset.
 
Methods inherited from class net.rim.device.api.crypto.AbstractPseudoRandomSource
getBytes, getBytes, getBytes, xorBytes, xorBytes, xorCopy, xorCopy
 
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

AESCTRDRBGPseudoRandomSource

public AESCTRDRBGPseudoRandomSource(byte[] seed)
Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key.

Parameters:
seed - The seed key to use. Note that the seed length can be up to 1024 bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

AESCTRDRBGPseudoRandomSource

public AESCTRDRBGPseudoRandomSource(byte[] seed,
                                    int offset,
                                    int length)
Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key.

Parameters:
seed - The seed key to use.
offset - The starting offset of the seed data.
length - The number of bytes to use as seed data. Note that the seed length can be up to 1024 bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

AESCTRDRBGPseudoRandomSource

public AESCTRDRBGPseudoRandomSource(byte[] seed,
                                    byte[] additionalSeed)
Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key and the additional seed. The two seeds will be combined before seeding the Deterministic Random Bit Generator (DRBG).

Parameters:
seed - The seed key to use. Note that the seed length can be up to 1024 bytes.
additionalSeed - The additional user provided seed to use. Note that additional seed's length can be up to 1024 bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

AESCTRDRBGPseudoRandomSource

public AESCTRDRBGPseudoRandomSource(byte[] seed,
                                    int offset,
                                    int length,
                                    byte[] additionalSeed,
                                    int additionalSeedOffset,
                                    int additionalSeedLength)
Creates an AESCTRDRBGPseudoRandomSource object using the specified seed key and the additional seed. The two seeds will be combined before seeding the Deterministic Random Bit Generator (DRBG).

Parameters:
seed - The seed key to use.
offset - The starting offset of the seed data.
length - The number of bytes to use as seed data. Note that the seed length can be up to 1024 bytes.
additionalSeed - The additional user seed to use.
additionalSeedoffset - The starting offset of the additional user seed. If additionalSeed is null, this value is ignored.
additionalSeedLength - The number of bytes to use as additional user seed. Note that additional seed's length can be up to 1024 bytes. If additionalSeed is null, this value is ignored.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0


Method Detail

getAlgorithm

public String getAlgorithm()
Returns the name of this algorithm, "AES CTR DRBG".

This method will always return the String "AES CTR DRBG".

Specified by:
getAlgorithm in interface PseudoRandomSource
Returns:
A String representing the name of the algorithm.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

xorBytes

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

Specified by:
xorBytes in interface PseudoRandomSource
Specified by:
xorBytes in class AbstractPseudoRandomSource
Parameters:
buffer - The buffer to xor the bytes into.
offset - The starting offset, or initial position of the data, within buffer.
length - The number of bytes to xor.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getAvailable

public int getAvailable()
Returns the number of pseudo random bytes currently available.

For DRBG sources that have an indefinite length but implement this interface, the value returned is the maximum signed value that will fit into an int.

Specified by:
getAvailable in interface PseudoRandomSource
Returns:
An integer that represents the number of bytes.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getMaxAvailable

public int getMaxAvailable()
Returns the maximum number of pseudo random bytes that this DRBG can produce.

For DRBG sources that have an indefinite length but implement this interface, the value returned is the maximum signed value that will fit into an int.

Specified by:
getMaxAvailable in interface PseudoRandomSource
Returns:
An integer that specifies the maximum number of random bytes that can be produced.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal