SHOW Signed SHOW Certicom
 

net.rim.device.api.crypto
Class CryptoInteger

java.lang.Object
  |
  +--net.rim.device.api.crypto.CryptoInteger

public class CryptoInteger
extends Object

Represents large unsigned integer arithmetic class.

Most operations are performed with respect to a modulus.

Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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: Certicom Category: Signed protected CryptoInteger()
          Deprecated. If you use this constructor, all of the public functions in this class may throw NullPointerExceptions. Instead use the public constructors.
 Category: Certicom Category: Signed   CryptoInteger(byte[] value)
          Constructs a CryptoInteger object with the given byte array.
 Category: Certicom Category: Signed   CryptoInteger(byte[] value, int offset, int length)
          Constructs a CryptoInteger object with the given byte array.
 Category: Certicom Category: Signed   CryptoInteger(CryptoInteger other)
          Creates a copy of a given CryptoInteger instance.
 Category: Certicom Category: Signed   CryptoInteger(int value)
          Creates a CryptoInteger object with the given integer parameter.
 Category: Certicom Category: Signed   CryptoInteger(String value)
          Constructs a CryptoInteger object with the given hexadecimal string.
 
Method Summary
 Category: Certicom Category: Signed  CryptoInteger add(CryptoInteger a, CryptoInteger modulus)
          Returns a CryptoInteger whose value is (this + a) mod modulus.
 Category: Certicom Category: Signed  int compareTo(CryptoInteger other)
          Compares this CryptoInteger with the specified CryptoInteger.
 Category: Certicom Category: Signed  int compareTo(int other)
          Compares this CryptoInteger with the specified integer value.
 Category: Certicom Category: Signed  void decrement(CryptoInteger a, CryptoInteger modulus)
          Decrements this CryptoInteger by a, all modulo modulus.
 Category: Certicom Category: Signed  void decrement(int a, CryptoInteger modulus)
          Decrements this CryptoInteger by a, all modulo modulus.
 Category: Certicom Category: Signed  void divideByTwo(CryptoInteger modulus)
          Divides this by two modulo modulus. i.e. the resulting value * 2 will be equivalent to this mod modulus.
 Category: Certicom Category: Signed  boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 Category: Certicom Category: Signed  CryptoInteger exponent(CryptoInteger exponent, CryptoInteger modulus)
          Returns a CryptoInteger whose value is thisexponent mod modulus.
 Category: Certicom Category: Signed  CryptoInteger gcd(CryptoInteger a)
          Returns the greatest common denominator of this and a.
 Category: Certicom Category: Signed  int hashCode()
          Returns a hash code value for the object.
 Category: Certicom Category: Signed  void increment(CryptoInteger a, CryptoInteger modulus)
          Increments this CryptoInteger by a, all modulo modulus.
 Category: Certicom Category: Signed  void increment(int a, CryptoInteger modulus)
          Increments this CryptoInteger by a, all modulo modulus.
 Category: Certicom Category: Signed  CryptoInteger invert(CryptoInteger modulus)
          Returns the inverse of this modulo modulus.
 Category: Certicom Category: Signed  boolean isOdd()
          Determines if this CryptoInteger is odd.
 Category: Certicom Category: Signed  CryptoInteger mod(CryptoInteger modulus)
          Returns a CryptoInteger whose value is this mod modulus.
 Category: Certicom Category: Signed  CryptoInteger multiply(CryptoInteger a, CryptoInteger modulus)
          Returns a CryptoInteger whose value is (this * a) mod modulus.
 Category: Certicom Category: Signed  void multiplyByTwo(CryptoInteger modulus)
          Multiplies this by two, modulo modulus.
 Category: Certicom Category: Signed  CryptoInteger square(CryptoInteger modulus)
          Returns a CryptoInteger whose value is this2 mod modulus.
 Category: Certicom Category: Signed  CryptoInteger subtract(CryptoInteger a, CryptoInteger modulus)
          Returns a CryptoInteger whose value is (this - a) mod modulus.
 Category: Certicom Category: Signed  byte[] toByteArray()
          Returns the byte array representation of the value.
 Category: Certicom Category: Signed  byte[] toByteArray(int length)
          Returns the byte array representation of the value, padded or truncated to the specified length.
 Category: Certicom Category: Signed  String toString()
          Returns the hexadecimal string representation of the value.
 Category: Certicom Category: Signed  String toString(int numberOfBytes)
          Returns the hexadecimal string representation of the value, padded or truncated to the specified number of bytes (the string length will be twice this number).
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CryptoInteger

protected CryptoInteger()
Deprecated. If you use this constructor, all of the public functions in this class may throw NullPointerExceptions. Instead use the public constructors.

Creates a CryptoInteger object.

This is the default constructor.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


CryptoInteger

public CryptoInteger(byte[] value)
Constructs a CryptoInteger object with the given byte array.

The first byte in the array is considered the most significant. The length of the given byte array must be in the range 1-256.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Parameters:
value - The byte array representation of the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


CryptoInteger

public CryptoInteger(byte[] value,
                     int offset,
                     int length)
Constructs a CryptoInteger object with the given byte array.

The first byte in the array is considered most significant.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Parameters:
value - The byte array representation of the value.
offset - The starting offset of the data to use from value.
length - The number of bytes to use. Must be in the range 1-256.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


CryptoInteger

public CryptoInteger(CryptoInteger other)
Creates a copy of a given CryptoInteger instance.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Parameters:
other - The CryptoInteger object to be copied.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


CryptoInteger

public CryptoInteger(int value)
Creates a CryptoInteger object with the given integer parameter.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Parameters:
value - The integer representation of the non-negative value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


CryptoInteger

public CryptoInteger(String value)
Constructs a CryptoInteger object with the given hexadecimal string.

Characters must be 0-9, A-F, or a-f. The first character in the string is considered most significant. The string must represent 1 to 256 full bytes, i.e. 2 characters per byte.

Note: This object is mutable, and therefore so is the hash code. Don't modify this object after you place it in a hashtable.

Parameters:
value - The hexadecimal string representation of the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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

add

public CryptoInteger add(CryptoInteger a,
                         CryptoInteger modulus)
                  throws ArithmeticException
Returns a CryptoInteger whose value is (this + a) mod modulus.

Parameters:
a - The CryptoInteger to be added to this.
modulus - The modulus under which the sum is performed.
Returns:
The value: (this + a) mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


compareTo

public int compareTo(CryptoInteger other)
Compares this CryptoInteger with the specified CryptoInteger.

Parameters:
other - The CryptoInteger to which this CryptoInteger is to be compared.
Returns:
Returns an integer less than, equal to, or greater than 0 if this CryptoInteger is numerically less than, equal to, or greater than other.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


compareTo

public int compareTo(int other)
Compares this CryptoInteger with the specified integer value.

Parameters:
other - An integer to which this CryptoInteger is to be compared.
Returns:
An integer less than, equal to, or greater than 0 if this CryptoInteger is numerically less than, equal to, or greater than other.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


decrement

public void decrement(CryptoInteger a,
                      CryptoInteger modulus)
               throws ArithmeticException
Decrements this CryptoInteger by a, all modulo modulus.

Parameters:
a - The CryptoInteger to be subtracted from this.
modulus - The modulus under which the decrement is performed.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


decrement

public void decrement(int a,
                      CryptoInteger modulus)
               throws ArithmeticException
Decrements this CryptoInteger by a, all modulo modulus.

Parameters:
a - The int to be subtracted from this.
modulus - The modulus under which the decrement is performed.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


divideByTwo

public void divideByTwo(CryptoInteger modulus)
                 throws ArithmeticException
Divides this by two modulo modulus. i.e. the resulting value * 2 will be equivalent to this mod modulus. If modulus is even, there are two possible results; here we return the solution that is in the range [0, this/2 - 1].
NOTE: The result of the operation does not exist if this is odd and modulus is even.

Parameters:
modulus - The modulus under which the division is performed. If this is odd, then modulus must be odd.
Throws:
ArithmeticException - Thrown if the modulus is zero or this is odd and modulus is even.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


equals

public boolean equals(Object obj)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

  • It is reflexive: for any reference value x, x.equals(x) should return true.
  • It is symmetric: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the object is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class Object
Since:
JDE 3.6.0

Following copied from class: Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


exponent

public CryptoInteger exponent(CryptoInteger exponent,
                              CryptoInteger modulus)
                       throws ArithmeticException
Returns a CryptoInteger whose value is thisexponent mod modulus.

Parameters:
exponent - The CryptoInteger that this is taken to the power of.
modulus - The modulus under which the exponentation is performed.
Returns:
Returns the value of thisexponent mod modulus.
Throws:
ArithmeticException - Thrown if the modulus or the exponent is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


gcd

public CryptoInteger gcd(CryptoInteger a)
Returns the greatest common denominator of this and a.

If both this and a are zero, the result is zero.

Parameters:
a - The value with which the GCD is to be computed.
Returns:
Returns the value of GCD( this, a ).
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the Object.equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Since:
JDE 3.6.0

Following copied from class: Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


increment

public void increment(CryptoInteger a,
                      CryptoInteger modulus)
               throws ArithmeticException
Increments this CryptoInteger by a, all modulo modulus.

Parameters:
a - The CryptoInteger to be added to this.
modulus - The modulus under which the increment is performed.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


increment

public void increment(int a,
                      CryptoInteger modulus)
               throws ArithmeticException
Increments this CryptoInteger by a, all modulo modulus.

Parameters:
a - The int to be added to this.
modulus - The modulus under which the increment is performed.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


invert

public CryptoInteger invert(CryptoInteger modulus)
                     throws ArithmeticException
Returns the inverse of this modulo modulus.

That is, this.invert(modulus) * this is equivalent to 1 modulo modulus.

Parameters:
modulus - The modulus under which the inverse is taken.
Returns:
Returns the value of this-1 mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero or this CryptoInteger has no multiplicative inverse mod modulus.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


isOdd

public boolean isOdd()
Determines if this CryptoInteger is odd.

Returns:
Returns true if and only if this CryptoInteger is odd.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


mod

public CryptoInteger mod(CryptoInteger modulus)
                  throws ArithmeticException
Returns a CryptoInteger whose value is this mod modulus.

Parameters:
modulus - The modulus under which this is reduced.
Returns:
Returns the value of this mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


multiply

public CryptoInteger multiply(CryptoInteger a,
                              CryptoInteger modulus)
                       throws ArithmeticException
Returns a CryptoInteger whose value is (this * a) mod modulus.

Parameters:
a - The CryptoInteger to be multiplied into this.
modulus - The modulus under which the multiplication is performed.
Returns:
Returns the value of (this * a) mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


multiplyByTwo

public void multiplyByTwo(CryptoInteger modulus)
                   throws ArithmeticException
Multiplies this by two, modulo modulus.

Parameters:
modulus - the modulus under which the multiplication is performed
Throws:
ArithmeticException - modulus is zero
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


square

public CryptoInteger square(CryptoInteger modulus)
                     throws ArithmeticException
Returns a CryptoInteger whose value is this2 mod modulus.

Parameters:
modulus - The modulus under which the squaring is performed.
Returns:
Returns the value of this2 mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


subtract

public CryptoInteger subtract(CryptoInteger a,
                              CryptoInteger modulus)
                       throws ArithmeticException
Returns a CryptoInteger whose value is (this - a) mod modulus.

Parameters:
a - The CryptoInteger to be subtracted from this.
modulus - The modulus under which the subtraction is performed.
Returns:
Returns (this - a) mod modulus.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


toByteArray

public byte[] toByteArray()
Returns the byte array representation of the value.

The first byte in the array is considered most significant. The leading zero bytes are stripped.

Returns:
A byte array containing the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


toByteArray

public byte[] toByteArray(int length)
Returns the byte array representation of the value, padded or truncated to the specified length.

The first byte in the array is considered most significant. A returned array that is 0 or >256 bytes long cannot be passed into the CryptoInteger constructor.

Parameters:
length - The desired byte array length, must be non-negative.
Returns:
The padded or truncated byte array representation of the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


toString

public String toString()
Returns the hexadecimal string representation of the value. The first character in the string is considered most significant. The leading zero character pairs are stripped. The returned string will use lowercase characters.

Overrides:
toString in class Object
Returns:
A hexadecimal String representing the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.


toString

public String toString(int numberOfBytes)
Returns the hexadecimal string representation of the value, padded or truncated to the specified number of bytes (the string length will be twice this number).

The first character in the string is considered most significant. The returned string will use lowercase characters.

Parameters:
numberOfBytes - The number of bytes of the value to be represented in the string.
Returns:
The truncated or padded hexadecimal string representation of the value.
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
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.