public class IntegerType extends AbstractDERType implements DEREncoder
Modifier and Type | Field and Description |
---|---|
private byte[] |
derItem
Integer to encode.
|
Constructor and Description |
---|
IntegerType(BigInteger item)
Creates a new integer type.
|
IntegerType(DERTag tag,
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 BigInteger |
decode(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 BigInteger |
decodeUnsigned(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(BigInteger i)
Converts the supplied big integer to a byte array.
|
encode, readBuffer
public IntegerType(BigInteger item)
item
- to DER encodepublic IntegerType(int item)
item
- to DER encodepublic IntegerType(DERTag tag, BigInteger item)
tag
- der tag associated with this typeitem
- to DER encodeIllegalArgumentException
- if the der tag is constructedpublic IntegerType(DERTag tag, int item)
tag
- der tag associated with this typeitem
- to DER encodeIllegalArgumentException
- if the der tag is constructedpublic byte[] encode()
DEREncoder
encode
in interface DEREncoder
public static BigInteger decode(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 BigInteger decodeUnsigned(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(BigInteger i)
i
- to convertCopyright © 2003-2019 Virginia Tech. All Rights Reserved.