net.rim.device.api.crypto
Class PRNGTest

java.lang.Object
  extended by net.rim.device.api.crypto.PRNGTest

public final class PRNGTest
extends Object

Performs tests to ensure that the pseudo random number generator (PRNG) is functioning correctly.

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 3.6.0

Field Summary
Category: Signed static int ALL_FIPS_TESTS_PASSED
          A mask representing all of the FIPS tests.
Category: Signed static int ALL_TESTS_PASSED
          A mask representing all of the tests.
Category: Signed static int LONG_RUNS_TEST_PASSED
          A mask representing the long runs test.
Category: Signed static int MONO_BIT_TEST_PASSED
          A mask representing the mono bit test.
Category: Signed static int POKER_TEST_PASSED
          A mask representing the poker test.
Category: Signed static int RUNS_TEST_PASSED
          A mask representing the runs test.
 
Method Summary
Category: Signed static int testPRNG(PseudoRandomSource source)
          Tests the pseudo-random source given the PseudoRandomSource object.
Category: Signed static int testRandomSource()
          Tests RandomSource for randomness.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

MONO_BIT_TEST_PASSED

public static final int MONO_BIT_TEST_PASSED
A mask representing the mono bit test. This value can be used as a mask with the results of the PRNG tests to determine if the mono bit test passed. For example: if ( ( result & MONO_BIT_TEST_PASSED ) == 0 ) { // mono bit test failed }

See Also:
Constant Field Values
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 3.6.0

POKER_TEST_PASSED

public static final int POKER_TEST_PASSED
A mask representing the poker test. This value can be used as a mask with the results of the PRNG tests to determine if the poker test passed. For example: if ( ( result & POKER_TEST_PASSED ) == 0 ) { // poker test failed }

See Also:
Constant Field Values
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 3.6.0

RUNS_TEST_PASSED

public static final int RUNS_TEST_PASSED
A mask representing the runs test. This value can be used as a mask with the results of the PRNG tests to determine if the runs test passed. For example: if ( ( result & RUNS_TEST_PASSED ) == 0 ) { // runs test failed }

See Also:
Constant Field Values
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 3.6.0

LONG_RUNS_TEST_PASSED

public static final int LONG_RUNS_TEST_PASSED
A mask representing the long runs test. This value can be used as a mask with the results of the PRNG tests to determine if the long runs test passed. For example: if ( ( result & LONG_RUNS_TEST_PASSED ) == 0 ) { // long runs test failed }

See Also:
Constant Field Values
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 3.6.0

ALL_TESTS_PASSED

public static final int ALL_TESTS_PASSED
A mask representing all of the tests. This value can be used as a mask with the results of the PRNG tests to determine if all of the tests passed. For example: if ( ( result & ALL_TESTS_PASSED ) == ALL_TESTS_PASSED ) { // one or more of the tests failed }

See Also:
Constant Field Values
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 3.6.0

ALL_FIPS_TESTS_PASSED

public static final int ALL_FIPS_TESTS_PASSED
A mask representing all of the FIPS tests. This value can be used as a mask with the results of the PRNG tests to determine if all of the FIPS tests passed. For example: if ( ( result & ALL_FIPS_TESTS_PASSED ) == ALL_FIPS_TESTS_PASSED ) { // one or more of the tests failed }

See Also:
Constant Field Values
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 3.6.0


Method Detail

testPRNG

public static int testPRNG(PseudoRandomSource source)
                    throws CryptoTokenException
Tests the pseudo-random source given the PseudoRandomSource object.

Parameters:
source - The pseudo-random source of the.
Returns:
A boolean that determines if the source is suitably random.
Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
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 3.6.0

testRandomSource

public static int testRandomSource()
Tests RandomSource for randomness.

Returns:
ALL_TESTS_PASSED if all tests passed.
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 3.6.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