|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.AbstractPseudoRandomSource
net.rim.device.api.crypto.X963KDFPseudoRandomSource
public final class X963KDFPseudoRandomSource
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.
Constructor Summary | ||
---|---|---|
|
X963KDFPseudoRandomSource(byte[] sharedSecret,
byte[] sharedInfo)
Creates an X963KDFPseudoRandomSource object using the specified parameters
and the default SHA-1 digest. |
|
|
X963KDFPseudoRandomSource(byte[] sharedSecret,
byte[] sharedInfo,
Digest digest)
Creates an X963KDFPseudoRandomSource object using the specified parameters
and the given digest. |
|
|
X963KDFPseudoRandomSource(byte[] sharedSecret,
int offset,
int length,
byte[] sharedInfo)
Creates an X963KDFPseudoRandomSource object using the specified parameters
and the default SHA-1 digest. |
|
|
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 | ||
---|---|---|
|
String |
getAlgorithm()
Returns the name of the algorithm, eg "X963KDF". |
|
int |
getAvailable()
Returns the number of pseudo random bytes currently available. |
|
int |
getMaxAvailable()
Returns the maximum number of pseudo random bytes that this PRNG can produce. |
|
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 |
---|
public X963KDFPseudoRandomSource(byte[] sharedSecret, byte[] sharedInfo)
X963KDFPseudoRandomSource
object using the specified parameters
and the default SHA-1 digest.
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).public X963KDFPseudoRandomSource(byte[] sharedSecret, int offset, int length, byte[] sharedInfo)
X963KDFPseudoRandomSource
object using the specified parameters
and the default SHA-1 digest.
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.public X963KDFPseudoRandomSource(byte[] sharedSecret, byte[] sharedInfo, Digest digest)
X963KDFPseudoRandomSource
object using the specified parameters
and the given digest.
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.public X963KDFPseudoRandomSource(byte[] sharedSecret, int offset, int length, byte[] sharedInfo, Digest digest)
X963KDFPseudoRandomSource
object using the specified parameters
and the given digest.
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.Method Detail |
---|
public String getAlgorithm()
getAlgorithm
in interface PseudoRandomSource
public void xorBytes(byte[] buffer, int offset, int length)
AbstractPseudoRandomSource
xorBytes
in interface PseudoRandomSource
xorBytes
in class AbstractPseudoRandomSource
buffer
- The byte array to xor the bytes into.offset
- The starting offset within buffer.length
- The number of bytes to xor.public int getAvailable()
PseudoRandomSource
For PRNG sources that have an indefinite length but implement
this interface, the value returned is Integer.MAX
.
getAvailable
in interface PseudoRandomSource
public int getMaxAvailable()
PseudoRandomSource
For PRNG sources that have an indefinite length but implement
this interface, the value returned is Integer.MAX
.
getMaxAvailable
in interface PseudoRandomSource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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