Class CBORBigInt

java.lang.Object
org.webpki.cbor.CBORObject
org.webpki.cbor.CBORBigInt
All Implemented Interfaces:
Cloneable, Comparable<CBORObject>

public class CBORBigInt extends CBORObject
Class for holding CBOR integer objects.
See Also:
  • Constructor Details

    • CBORBigInt

      public CBORBigInt(BigInteger value)
      Creates a CBOR integer value of any size.

      Note: if value is within the CBOR int range, int encoding will be used, otherwise value will be encoded as a CBOR bigint.

      Parameters:
      value - Integer in BigInteger format
      See Also:
  • Method Details

    • createInt128

      public static CBORBigInt createInt128(BigInteger value)
      Creates a CBOR int128 object.

      This method creates a CBORBigInt object, where the value is verified to be within -0x80000000000000000000000000000000 to 0x7fffffffffffffffffffffffffffffff.

      Parameters:
      value - Integer
      Returns:
      CBORBigInt object
      Throws:
      CBORException - If value is out of range
      See Also:
    • createUint128

      public static CBORBigInt createUint128(BigInteger value)
      Creates a CBOR uint128 object.

      This method creates a CBORBigInt object, where the value is verified to be within 0 to 0xffffffffffffffffffffffffffffffff.

      Parameters:
      value - Integer
      Returns:
      CBORBigInt object
      Throws:
      CBORException - If value is out of range
      See Also: