net.rim.device.api.crypto
Class NullMAC
java.lang.Object
net.rim.device.api.crypto.AbstractMAC
net.rim.device.api.crypto.NullMAC
- All Implemented Interfaces:
- MAC
public final class NullMAC
- extends AbstractMAC
- implements MAC
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.
- 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 |
|
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. |
NullMAC
public NullMAC()
- Creates a new
NullMAC
object.
Note that this will default to returning
true in the checkMAC method.
- 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
NullMAC
public NullMAC(boolean checkMAC)
- Creates a new
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.
- Parameters:
checkMAC
- The boolean that will be
returned by the checkMAC method.- 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
getAlgorithm
public String getAlgorithm()
- Returns the name of this digest, "Null" since this is the null MAC.
- Specified by:
getAlgorithm
in interface MAC
- Specified by:
getAlgorithm
in class AbstractMAC
- Returns:
- A String that represents 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
reset
public void reset()
- Description copied from class:
AbstractMAC
- Reinitializes the MAC.
- Specified by:
reset
in interface MAC
- Specified by:
reset
in class AbstractMAC
- 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
update
public void update(byte[] data,
int offset,
int length)
- Description copied from class:
AbstractMAC
- Feeds more data into the MAC algorithm.
- Specified by:
update
in interface MAC
- Specified by:
update
in class AbstractMAC
- Parameters:
data
- 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.- 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
getLength
public int getLength()
- Returns the length in bytes of the MAC, zero in this case.
- Specified by:
getLength
in interface MAC
- Specified by:
getLength
in class AbstractMAC
- Returns:
- An integer that represents the length of the MAC.
- 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
getMAC
public int getMAC(byte[] buffer,
int offset,
boolean reset)
- Gets the null MAC by returning zero.
- Specified by:
getMAC
in interface MAC
- Specified by:
getMAC
in class AbstractMAC
- Parameters:
buffer
- Igorned.offset
- Ignored.
reset
- If true then the MAC is reset.
- Returns:
- An integer with the value zero, since this is a null MAC.
- 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
checkMAC
public boolean checkMAC(byte[] mac,
int offset)
- Returns true or false depending on how this object was constructed.
- Specified by:
checkMAC
in interface MAC
- Overrides:
checkMAC
in class AbstractMAC
- Parameters:
mac
- The byte array containing the mac data.offset
- The offset of the mac data.
- Returns:
- the application can specify what value to return in the constructor.
- 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