public final class

BigIntegers

extends Object
java.lang.Object
   ↳ org.bouncycastle.util.BigIntegers

Class Overview

BigInteger utilities.

Summary

Public Constructors
BigIntegers()
Public Methods
static byte[] asUnsignedByteArray(BigInteger value)
Return the passed in value as an unsigned byte array.
static BigInteger createRandomInRange(BigInteger min, BigInteger max, SecureRandom random)
Return a random BigInteger not less than 'min' and not greater than 'max'
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BigIntegers ()

Public Methods

public static byte[] asUnsignedByteArray (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.

public static BigInteger createRandomInRange (BigInteger min, BigInteger max, 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]