net.rim.device.api.crypto
Class X963KDFPseudoRandomSource

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

public final class X963KDFPseudoRandomSource
extends AbstractPseudoRandomSource
implements PseudoRandomSource

Implements the key derivation function (KDF) found in ANSI X9.63. This KDF does not have a definite length and can be used to generate a variety of symmetric keys.

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

Constructor Summary
Category: Signed X963KDFPseudoRandomSource(byte[] sharedSecret, byte[] sharedInfo)
          Creates an X963KDFPseudoRandomSource object using the specified parameters and the default SHA-1 digest.
Category: Signed X963KDFPseudoRandomSource(byte[] sharedSecret, byte[] sharedInfo, Digest digest)
          Creates an X963KDFPseudoRandomSource object using the specified parameters and the given digest.
Category: Signed X963KDFPseudoRandomSource(byte[] sharedSecret, int offset, int length, byte[] sharedInfo)
          Creates an X963KDFPseudoRandomSource object using the specified parameters and the default SHA-1 digest.
Category: Signed X963KDFPseudoRandomSource(byte[] sharedSecret, int offset, int length, byte[] sharedInfo, Digest digest)
          Creates an X963KDFPseudoRandomSource object using the specified parameters and the given digest.
 
Method Summary
Category: Signed  String getAlgorithm()
          Returns the name of the algorithm, eg "X963KDF".
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 random bytes into the given 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

X963KDFPseudoRandomSource

public X963KDFPseudoRandomSource(byte[] sharedSecret,
                                 byte[] sharedInfo)
Creates an X963KDFPseudoRandomSource object using the specified parameters and the default SHA-1 digest.

Parameters:
sharedSecret - A byte array containing the secret data shared between two parties.
sharedInfo - A byte array containing the optional, additional shared information (can be null).
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

X963KDFPseudoRandomSource

public X963KDFPseudoRandomSource(byte[] sharedSecret,
                                 int offset,
                                 int length,
                                 byte[] sharedInfo)
Creates an X963KDFPseudoRandomSource object using the specified parameters and the default SHA-1 digest.

Parameters:
sharedSecret - A byte array containing the secret data shared between two parties.
offset - The offset, or initial position of the shared secret data, within the array.
length - The number of bytes to use as shared secret data.
sharedInfo - The additional shared information (can be null). This is an optional parameter.
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

X963KDFPseudoRandomSource

public X963KDFPseudoRandomSource(byte[] sharedSecret,
                                 byte[] sharedInfo,
                                 Digest digest)
Creates an X963KDFPseudoRandomSource object using the specified parameters and the given digest.

Parameters:
sharedSecret - A byte array containing the secret data shared between two parties.
sharedInfo - The additional shared information (can be null). This parameter is optional.
digest - An instance of a digest algorithm to use for the key generation.
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

X963KDFPseudoRandomSource

public X963KDFPseudoRandomSource(byte[] sharedSecret,
                                 int offset,
                                 int length,
                                 byte[] sharedInfo,
                                 Digest digest)
Creates an X963KDFPseudoRandomSource object using the specified parameters and the given digest.

Parameters:
sharedSecret - A byte array containing the secret data shared between two parties.
offset - The offset, or initial position, of the shared secret data within the array.
length - The number of bytes to use as shared secret data.
sharedInfo - A byte array containing the additional shared information (can be null). This parameter is optional.
digest - An instance of a digest algorithm to use for the key generation.
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

getAlgorithm

public String getAlgorithm()
Returns the name of the algorithm, eg "X963KDF".

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 3.6.0

xorBytes

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

Specified by:
xorBytes in interface PseudoRandomSource
Specified by:
xorBytes in class AbstractPseudoRandomSource
Parameters:
buffer - The byte array to xor the bytes into.
offset - The starting offset 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 3.6.0

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.

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 3.6.0

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.

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 3.6.0





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.