public class IntegerType extends AbstractDERType implements DEREncoder
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
derItem
Integer to encode.
|
| Constructor and Description |
|---|
IntegerType(java.math.BigInteger item)
Creates a new integer type.
|
IntegerType(DERTag tag,
java.math.BigInteger item)
Creates a new integer type.
|
IntegerType(DERTag tag,
int item)
Creates a new integer type.
|
IntegerType(int item)
Creates a new integer type.
|
| Modifier and Type | Method and Description |
|---|---|
static java.math.BigInteger |
decode(java.nio.ByteBuffer encoded)
Converts bytes in the buffer to an integer by reading from the current position to the limit, which assumes the
bytes of the integer are in big-endian order.
|
static java.math.BigInteger |
decodeUnsigned(java.nio.ByteBuffer encoded)
Converts bytes in the buffer to an unsigned integer by reading from the current position to the limit, which
assumes the bytes of the integer are in big-endian order.
|
byte[] |
encode()
Encode this object into it's DER type.
|
static byte[] |
toBytes(java.math.BigInteger i)
Converts the supplied big integer to a byte array.
|
encode, readBufferpublic IntegerType(java.math.BigInteger item)
item - to DER encodepublic IntegerType(int item)
item - to DER encodepublic IntegerType(DERTag tag, java.math.BigInteger item)
tag - der tag associated with this typeitem - to DER encodejava.lang.IllegalArgumentException - if the der tag is constructedpublic IntegerType(DERTag tag, int item)
tag - der tag associated with this typeitem - to DER encodejava.lang.IllegalArgumentException - if the der tag is constructedpublic byte[] encode()
DEREncoderencode in interface DEREncoderpublic static java.math.BigInteger decode(java.nio.ByteBuffer encoded)
encoded - buffer containing DER-encoded data where the buffer is positioned at the start of integer bytes
and the limit is set beyond the last byte of integer data.public static java.math.BigInteger decodeUnsigned(java.nio.ByteBuffer encoded)
encoded - buffer containing DER-encoded data where the buffer is positioned at the start of integer bytes
and the limit is set beyond the last byte of integer data.public static byte[] toBytes(java.math.BigInteger i)
i - to convert