|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.crypto.AbstractMAC
net.rim.device.api.crypto.NullMAC
public final class NullMAC
The NullMAC class implements a trivial algorithm (as in none). The methods
in this class do not perform any operations on the given data.
For information on cryptographic algorithms, see Crypto Algorithms.
| Constructor Summary | ||
|---|---|---|
|
NullMAC()
Creates a new NullMAC object. |
|
|
NullMAC(boolean checkMAC)
Creates a new NullMAC object. |
|
| Method Summary | ||
|---|---|---|
|
boolean |
checkMAC(byte[] mac,
int offset)
Returns true or false depending on how this object was constructed. |
|
String |
getAlgorithm()
Returns the name of this digest, "Null" since this is the null MAC. |
|
int |
getLength()
Returns the length in bytes of the MAC, zero in this case. |
|
int |
getMAC(byte[] buffer,
int offset,
boolean reset)
Gets the null MAC by returning zero. |
|
void |
reset()
Reinitializes the MAC. |
|
void |
update(byte[] data,
int offset,
int length)
Feeds more data into the MAC algorithm. |
| Methods inherited from class net.rim.device.api.crypto.AbstractMAC |
|---|
checkMAC, checkMAC, checkMAC, getMAC, getMAC, getMAC, update, update |
| 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.MAC |
|---|
checkMAC, checkMAC, checkMAC, getMAC, getMAC, getMAC, update, update |
| Constructor Detail |
|---|
public NullMAC()
NullMAC object.
Note that this will default to returning true in the checkMAC method.
public NullMAC(boolean checkMAC)
NullMAC object.
This constructor takes in a boolean that will be returned by the checkMAC method. This allows for an application to define exactly how it thinks the checkMAC method should work conceptually.
checkMAC - The boolean that will be
returned by the checkMAC method.| Method Detail |
|---|
public String getAlgorithm()
getAlgorithm in interface MACgetAlgorithm in class AbstractMACpublic void reset()
AbstractMAC
reset in interface MACreset in class AbstractMAC
public void update(byte[] data,
int offset,
int length)
AbstractMAC
update in interface MACupdate in class AbstractMACdata - The array containing the input data.offset - The offset, or initial position, of the data within the array.length - The length of the input data, in bytes.public int getLength()
getLength in interface MACgetLength in class AbstractMAC
public int getMAC(byte[] buffer,
int offset,
boolean reset)
getMAC in interface MACgetMAC in class AbstractMACbuffer - Igorned.offset - Ignored.
reset - If true then the MAC is reset.
public boolean checkMAC(byte[] mac,
int offset)
checkMAC in interface MACcheckMAC in class AbstractMACmac - The byte array containing the mac data.offset - The offset of the mac data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.