BigIntegers (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.util

## Class BigIntegers

- java.lang.Object
- - org.bouncycastle.util.BigIntegers

-     public final class BigIntegers
      extends java.lang.Object

  BigInteger utilities.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BigIntegers()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static byte[]` | `asUnsignedByteArray(java.math.BigInteger value)` Return the passed in value as an unsigned byte array.
    `static byte[]` | `asUnsignedByteArray(int length, java.math.BigInteger value)` Return the passed in value as an unsigned byte array.
    `static java.math.BigInteger` | `createRandomInRange(java.math.BigInteger min, java.math.BigInteger max, java.security.SecureRandom random)` Return a random BigInteger not less than 'min' and not greater than 'max'
    `static java.math.BigInteger` | `fromUnsignedByteArray(byte[] buf)`
    `static java.math.BigInteger` | `fromUnsignedByteArray(byte[] buf, int off, int length)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BigIntegers

          public BigIntegers()

  - ### Method Detail

    - #### asUnsignedByteArray

          public static byte[] asUnsignedByteArray(java.math.BigInteger value)

      Return the passed in value as an unsigned byte array.
      Parameters:
        `value` - value to be converted.
      Returns:
        a byte array without a leading zero byte if present in the signed encoding.

    - #### asUnsignedByteArray

          public static byte[] asUnsignedByteArray(int length,
                                   java.math.BigInteger value)

      Return the passed in value as an unsigned byte array.
      Parameters:
        `value` - value to be converted.
      Returns:
        a byte array without a leading zero byte if present in the signed encoding.

    - #### createRandomInRange

          public static java.math.BigInteger createRandomInRange(java.math.BigInteger min,
                                                 java.math.BigInteger max,
                                                 java.security.SecureRandom random)

      Return a random BigInteger not less than 'min' and not greater than 'max'
      Parameters:
        `min` - the least value that may be generated
        `max` - the greatest value that may be generated
        `random` - the source of randomness
      Returns:
        a random BigInteger value in the range [min,max]

    - #### fromUnsignedByteArray

          public static java.math.BigInteger fromUnsignedByteArray(byte[] buf)

    - #### fromUnsignedByteArray

          public static java.math.BigInteger fromUnsignedByteArray(byte[] buf,
                                                   int off,
                                                   int length)