Package io.anyline.nfc.bouncycastle.asn1
Class ASN1Integer
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.asn1.ASN1Encodable
,io.anyline.nfc.bouncycastle.util.Encodable
public class ASN1Integer extends ASN1Primitive
Class representing the ASN.1 INTEGER type.
-
-
Constructor Summary
Constructors Constructor Description ASN1Integer(long value)
Construct an INTEGER from the passed in long value. ASN1Integer(BigInteger value)
Construct an INTEGER from the passed in BigInteger value. ASN1Integer(Array<byte> bytes)
Construct an INTEGER from the passed in byte array.
-
Method Summary
Modifier and Type Method Description static ASN1Integer
getInstance(Object obj)
Return an integer from the passed in object. static ASN1Integer
getInstance(ASN1TaggedObject taggedObject, boolean explicit)
Return an Integer from a tagged object. BigInteger
getPositiveValue()
in some cases positive values get crammed into a space, that's not quite big enough... BigInteger
getValue()
boolean
hasValue(int x)
boolean
hasValue(long x)
boolean
hasValue(BigInteger x)
int
intPositiveValueExact()
int
intValueExact()
long
longValueExact()
int
hashCode()
String
toString()
-
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Primitive
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive
-
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ASN1Integer
ASN1Integer(long value)
Construct an INTEGER from the passed in long value.- Parameters:
value
- the long representing the value desired.
-
ASN1Integer
ASN1Integer(BigInteger value)
Construct an INTEGER from the passed in BigInteger value.- Parameters:
value
- the BigInteger representing the value desired.
-
ASN1Integer
ASN1Integer(Array<byte> bytes)
Construct an INTEGER from the passed in byte array.- Parameters:
bytes
- the byte array representing a 2's complement encoding of a BigInteger.
-
-
Method Detail
-
getInstance
static ASN1Integer getInstance(Object obj)
Return an integer from the passed in object.
- Parameters:
obj
- an ASN1Integer or an object that can be converted into one.- Returns:
an ASN1Integer instance.
-
getInstance
static ASN1Integer getInstance(ASN1TaggedObject taggedObject, boolean explicit)
Return an Integer from a tagged object.
- Parameters:
taggedObject
- the tagged object holding the object we wantexplicit
- true if the object is meant to be explicitly tagged false otherwise.- Returns:
an ASN1Integer instance.
-
getPositiveValue
BigInteger getPositiveValue()
in some cases positive values get crammed into a space, that's not quite big enough...
- Returns:
the BigInteger that results from treating this ASN.1 INTEGER as unsigned.
-
getValue
BigInteger getValue()
-
hasValue
boolean hasValue(int x)
-
hasValue
boolean hasValue(long x)
-
hasValue
boolean hasValue(BigInteger x)
-
intPositiveValueExact
int intPositiveValueExact()
-
intValueExact
int intValueExact()
-
longValueExact
long longValueExact()
-
hashCode
int hashCode()
-
-
-
-