SHOW Signed SHOW CryptoExtensionAPI

net.rim.device.api.crypto
Class AbstractMAC

java.lang.Object
  |
  +--net.rim.device.api.crypto.AbstractMAC
Direct Known Subclasses:
CBCMAC, HMAC, NullMAC

public abstract class AbstractMAC
extends Object

Implements the helper methods of the MAC interface.

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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

Since:
JDE 3.6.0

Constructor Summary
 Category: Signed Category: CryptoExtensionAPI protected AbstractMAC()
          Creates a new AbstractMAC object.
 
Method Summary
 Category: Signed Category: CryptoExtensionAPI  boolean checkMAC(byte[] mac)
          Returns true if the MAC calculated so far is the same as the given MAC.
 Category: Signed Category: CryptoExtensionAPI  boolean checkMAC(byte[] mac, boolean reset)
          Returns true if the MAC calculated so far is the same as the given MAC.
 Category: Signed Category: CryptoExtensionAPI  boolean checkMAC(byte[] mac, int offset)
          Returns true if the MAC calculated so far is the same as the given MAC.
 Category: Signed Category: CryptoExtensionAPI  boolean checkMAC(byte[] mac, int offset, boolean reset)
          Returns true if the MAC calculated so far is the same as the given MAC.
 Category: Signed Category: CryptoExtensionAPI abstract  String getAlgorithm()
          Returns the name of the digest or block cipher used, such as "HMAC".
 Category: Signed Category: CryptoExtensionAPI abstract  int getLength()
          Returns the length, in bytes, of the MAC.
 Category: Signed Category: CryptoExtensionAPI  byte[] getMAC()
          Returns a byte array containing the MAC of all the input data since the last reset.
 Category: Signed Category: CryptoExtensionAPI  byte[] getMAC(boolean reset)
          Returns a byte array containing the MAC of all the input data since the last reset.
 Category: Signed Category: CryptoExtensionAPI  int getMAC(byte[] buffer, int offset)
          Puts the MAC of all the input data since the last reset into the given buffer starting at the specified offset.
 Category: Signed Category: CryptoExtensionAPI abstract  int getMAC(byte[] buffer, int offset, boolean reset)
          Puts the MAC of all the input data since the last reset into the given buffer starting at the specified offset.
 Category: Signed Category: CryptoExtensionAPI abstract  void reset()
          Reinitializes the MAC.
 Category: Signed Category: CryptoExtensionAPI  void update(byte[] data)
          Feeds more data into the MAC algorithm.
 Category: Signed Category: CryptoExtensionAPI abstract  void update(byte[] data, int offset, int length)
          Feeds more data into the MAC algorithm.
 Category: Signed Category: CryptoExtensionAPI  void update(int data)
          Feeds more data into the MAC algorithm.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMAC

protected AbstractMAC()
Creates a new AbstractMAC object.

This is the default constructor.

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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
Method Detail

getAlgorithm

public abstract String getAlgorithm()
Returns the name of the digest or block cipher used, such as "HMAC".

Returns:
A String representing the name of the digest or cipher.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

reset

public abstract void reset()
                    throws CryptoTokenException
Reinitializes the MAC.

Throws:
CryptoTokenException - Thrown if an error occurs with the crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

update

public void update(int data)
            throws CryptoTokenException
Feeds more data into the MAC algorithm.

Parameters:
data - A byte of input data.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

update

public void update(byte[] data)
            throws CryptoTokenException
Feeds more data into the MAC algorithm.

Parameters:
data - The array containing the input data. The entire array is added to the MAC.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

update

public abstract void update(byte[] data,
                            int offset,
                            int length)
                     throws CryptoTokenException
Feeds more data into the MAC algorithm.

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.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

getLength

public abstract int getLength()
Returns the length, in bytes, of the MAC.

Returns:
An integer that represents the length of 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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

getMAC

public byte[] getMAC()
              throws CryptoTokenException
Returns a byte array containing the MAC of all the input data since the last reset. The MAC is then reset.

Returns:
A byte array containing the MAC.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

getMAC

public byte[] getMAC(boolean reset)
              throws CryptoTokenException
Returns a byte array containing the MAC of all the input data since the last reset.

Parameters:
reset - if true then the MAC is reset.
Returns:
A byte array containing the MAC.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

getMAC

public int getMAC(byte[] buffer,
                  int offset)
           throws CryptoTokenException
Puts the MAC of all the input data since the last reset into the given buffer starting at the specified offset. The MAC is then reset.

Parameters:
buffer - The array to contain the MAC.
offset - The offset, or initial position, of teh MAC data within the buffer.
Returns:
An integer representing the number of bytes written to the buffer.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

getMAC

public abstract int getMAC(byte[] buffer,
                           int offset,
                           boolean reset)
                    throws CryptoTokenException
Puts the MAC of all the input data since the last reset into the given buffer starting at the specified offset. The MAC is then reset.

Parameters:
buffer - The array to contain the MAC.
offset - The offset, or initial position, of teh MAC data within the buffer.
reset - If true then the MAC is reset.
Returns:
An integer representing the number of bytes written to the buffer.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

checkMAC

public boolean checkMAC(byte[] mac)
                 throws CryptoTokenException
Returns true if the MAC calculated so far is the same as the given MAC. The MAC is then reset.

Parameters:
mac - The MAC to check against.
Returns:
Returns true if the MAC verifies.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

checkMAC

public boolean checkMAC(byte[] mac,
                        boolean reset)
                 throws CryptoTokenException
Returns true if the MAC calculated so far is the same as the given MAC.

Parameters:
mac - The MAC to check against.
reset - if true then the MAC is reset.
Returns:
Returns true if the MAC verifies.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

checkMAC

public boolean checkMAC(byte[] mac,
                        int offset)
                 throws CryptoTokenException
Returns true if the MAC calculated so far is the same as the given MAC. The MAC is then reset.

Parameters:
mac - The array containing the MAC to check against.
offset - The starting offset of the MAC in the array.
Returns:
Returns true if the MAC verifies.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.

checkMAC

public boolean checkMAC(byte[] mac,
                        int offset,
                        boolean reset)
                 throws CryptoTokenException
Returns true if the MAC calculated so far is the same as the given MAC.

Parameters:
mac - The array containing the MAC to check against.
offset - The starting offset of the MAC in the array.
reset - if true then the MAC is reset.
Returns:
Returns true if the MAC verifies.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
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.
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.


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.