SHOW Signed
 

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:
JDE 3.6.0

Constructor Summary
 Category: Signed NullMAC()
          Creates a new NullMAC object.
 Category: Signed NullMAC(boolean checkMAC)
          Creates a new NullMAC object.
 
Method Summary
 Category: Signed  boolean checkMAC(byte[] mac, int offset)
          Returns true or false depending on how this object was constructed.
 Category: Signed  String getAlgorithm()
          Returns the name of this digest, "Null" since this is the null MAC.
 Category: Signed  int getLength()
          Returns the length in bytes of the MAC, zero in this case.
 Category: Signed  int getMAC(byte[] buffer, int offset, boolean reset)
          Gets the null MAC by returning zero.
 Category: Signed  void reset()
          Reinitializes the MAC.
 Category: Signed  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

NullMAC

public NullMAC()
Creates a new NullMAC object.

Note that this will default to returning true in the checkMAC method.

Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.
Method Detail

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.
Since:
JDE 3.6.0
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.

getAlgorithm

public String getAlgorithm()
Returns the name of this digest, "Null" since this is the null MAC.
Specified by:
getAlgorithm in interface MAC
Overrides:
getAlgorithm in class AbstractMAC
Returns:
A String that represents the name of the algorithm.
Since:
JDE 3.6.0
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.

getLength

public int getLength()
Returns the length in bytes of the MAC, zero in this case.

Specified by:
getLength in interface MAC
Overrides:
getLength in class AbstractMAC
Since:
JDE 3.6.0

Following copied from interface: MAC
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.

getMAC

public int getMAC(byte[] buffer,
                  int offset,
                  boolean reset)
Gets the null MAC by returning zero.

Specified by:
getMAC in interface MAC
Overrides:
getMAC in class AbstractMAC
Parameters:
buffer - Igorned.
offset - Ignored.

Returns:
An integer with the value zero, since this is a null MAC.
Since:
JDE 3.6.0
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.

reset

public void reset()
Description copied from interface: MAC
Reinitializes the MAC.

Specified by:
reset in interface MAC
Overrides:
reset in class AbstractMAC
Since:
JDE 3.6.0

Following copied from interface: MAC
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.

update

public void update(byte[] data,
                   int offset,
                   int length)
Description copied from interface: MAC
Feeds more data into the MAC algorithm.

Specified by:
update in interface MAC
Overrides:
update in class AbstractMAC
Since:
JDE 3.6.0

Following copied from interface: MAC
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.
Throws:
CryptoTokenException - Thrown when a problem occurs with a 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.



Copyright 1999-2009 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.