Package org.gudy.bouncycastle.util
Class BigIntegers
java.lang.Object
org.gudy.bouncycastle.util.BigIntegers
BigInteger utilities.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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'
-
Field Details
-
MAX_ITERATIONS
private static final int MAX_ITERATIONS- See Also:
-
ZERO
-
-
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.
-
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]
-