Package org.bouncycastle.util
Class BigIntegers
java.lang.Object
org.bouncycastle.util.BigIntegers
public final class BigIntegers extends Object
BigInteger utilities.
-
Constructor Summary
Constructors Constructor Description BigIntegers() -
Method Summary
Modifier and Type Method Description static byte[]asUnsignedByteArray(int length, BigInteger value)Return the passed in value as an unsigned byte array.static byte[]asUnsignedByteArray(BigInteger value)Return the passed in value as an unsigned byte array.static BigIntegercreateRandomInRange(BigInteger min, BigInteger max, SecureRandom random)Return a random BigInteger not less than 'min' and not greater than 'max'
-
Constructor Details
-
BigIntegers
public BigIntegers()
-
-
Method Details
-
asUnsignedByteArray
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
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
Return a random BigInteger not less than 'min' and not greater than 'max'- Parameters:
min- the least value that may be generatedmax- the greatest value that may be generatedrandom- the source of randomness- Returns:
- a random BigInteger value in the range [min,max]
-