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.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

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 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 clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

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 clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

getAlgorithm

public String getAlgorithm()
Returns the name of this digest, "Null" since this is the null MAC.
Returns:
A String that represents the name of the algorithm.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

reset

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

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

update

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

Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getLength

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

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getMAC

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

Parameters:
buffer - Igorned.
offset - Ignored.

Returns:
An integer with the value zero, since this is a null MAC.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

checkMAC

public boolean checkMAC(byte[] mac,
                        int offset)
Returns true or false depending on how this object was constructed.

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 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2004 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.