Class BigIntegerUtils

java.lang.Object
org.forgerock.json.jose.utils.BigIntegerUtils

public final class BigIntegerUtils extends Object
Utils to complement bit operations not covered by the BigInteger functions.
  • Method Details

    • toBytesUnsigned

      public static byte[] toBytesUnsigned(BigInteger x)
      Returns the magnitude big-endian byte array of a big integer.
      Parameters:
      x - a big integer
      Returns:
      the magnitude big-endian byte array of x
    • base64UrlDecode

      public static BigInteger base64UrlDecode(String magnitudeBase64UrlEncoded)
      Decode a big-endian base64 url encoding of a magnitude big integer and transform it as a positive big integer.
      Parameters:
      magnitudeBase64UrlEncoded - big-endian base64 url encoding of a big integer magnitude
      Returns:
      a positive big integer with the magnitude decoded from thhe