| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| pack-priv static final int | |
| pack-priv static final int | |
| private final int | |
| pack-priv static final ASN1UniversalType |
| Access | Constructor and Description |
|---|---|
| public | ASN1Integer(long
the long representing the value desired. value)Construct an INTEGER from the passed in long value. |
| public | ASN1Integer(BigInteger
the BigInteger representing the value desired. value)Construct an INTEGER from the passed in BigInteger value. |
| public | ASN1Integer(byte[]
the byte array representing a 2's complement encoding of a BigInteger. bytes)Construct an INTEGER from the passed in byte array. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | asn1Equals(ASN1Primitive o)
Implements abstract org. Equality (similarity) comparison for two ASN1Primitive objects. |
| pack-priv static ASN1Integer | |
| pack-priv void | encode(ASN1OutputStream out, boolean withTag)
Implements abstract org.
|
| pack-priv boolean | encodeConstructed()
Implements abstract org. Return true if this objected is a CONSTRUCTED one, false otherwise. |
| pack-priv int | encodedLength(boolean withTag)
Implements abstract org.
|
| public static ASN1Integer | Returns: an ASN1Integer instance.an ASN1Integer or an object that can be converted into one. obj)Return an integer from the passed in object. |
| public static ASN1Integer | Returns: an ASN1Integer instance.the tagged object holding the object we want taggedObject, boolean true if the object is meant to be explicitly
tagged false otherwise. explicit)Return an Integer from a tagged object. |
| public BigInteger | Returns: the BigInteger that results from treating this ASN.1 INTEGER as unsigned.in some cases positive values get crammed into a space, that's not quite big enough... |
| public BigInteger | |
| public int | hashCode()
Implements abstract org. Returns a hash code value for this object. |
| public boolean | |
| public boolean | |
| public boolean | |
| public int | |
| pack-priv static int | |
| public int | |
| pack-priv static boolean | Returns: true if the (in)put fails this validation.The raw encoding of the integer. bytes)Apply the correct validation for an INTEGER primitive following the BER rules. |
| pack-priv static long | |
| public long | |
| pack-priv static int | |
| public String |
| bytes | back to summary |
|---|---|
| private final byte[] bytes | |
| SIGN_EXT_SIGNED | back to summary |
|---|---|
| pack-priv static final int SIGN_EXT_SIGNED | |
| SIGN_EXT_UNSIGNED | back to summary |
|---|---|
| pack-priv static final int SIGN_EXT_UNSIGNED | |
| start | back to summary |
|---|---|
| private final int start | |
| TYPE | back to summary |
|---|---|
| pack-priv static final ASN1UniversalType TYPE | |
| ASN1Integer | back to summary |
|---|---|
| public ASN1Integer(long value) Construct an INTEGER from the passed in long value.
| |
| ASN1Integer | back to summary |
|---|---|
| public ASN1Integer(BigInteger value) Construct an INTEGER from the passed in BigInteger value.
| |
| ASN1Integer | back to summary |
|---|---|
| public ASN1Integer(byte[] bytes) Construct an INTEGER from the passed in byte array. Note Strict Validation applied by default. It has turned out that there are still a few applications that struggle with the ASN.1 BER encoding rules for an INTEGER as described in: https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf Section 8.3.2. Users can set the 'org.bouncycastle.asn1.allow_unsafe_integer' to 'true' and a looser validation will be applied. Users must recognise that this is not ideal and may pave the way for an exploit based around a faulty encoding in the future.
| |
| ASN1Integer | back to summary |
|---|---|
| pack-priv ASN1Integer(byte[] bytes, boolean clone) | |
| asn1Equals | back to summary |
|---|---|
| pack-priv boolean asn1Equals(ASN1Primitive o) Implements abstract org. Doc from org. Equality (similarity) comparison for two ASN1Primitive objects. | |
| createPrimitive | back to summary |
|---|---|
| pack-priv static ASN1Integer createPrimitive(byte[] contents) | |
| encode | back to summary |
|---|---|
| pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException Implements abstract org. | |
| encodeConstructed | back to summary |
|---|---|
| pack-priv boolean encodeConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| encodedLength | back to summary |
|---|---|
| pack-priv int encodedLength(boolean withTag) Implements abstract org. | |
| getInstance | back to summary |
|---|---|
| public static ASN1Integer getInstance(Object obj) Return an integer from the passed in object.
| |
| getInstance | back to summary |
|---|---|
| public static ASN1Integer getInstance(ASN1TaggedObject taggedObject, boolean explicit) Return an Integer from a tagged object.
| |
| getPositiveValue | back to summary |
|---|---|
| public BigInteger getPositiveValue() in some cases positive values get crammed into a space, that's not quite big enough...
| |
| getValue | back to summary |
|---|---|
| public BigInteger getValue() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(int x) | |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(long x) | |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(BigInteger x) | |
| intPositiveValueExact | back to summary |
|---|---|
| public int intPositiveValueExact() | |
| intValue | back to summary |
|---|---|
| pack-priv static int intValue(byte[] bytes, int start, int signExt) | |
| intValueExact | back to summary |
|---|---|
| public int intValueExact() | |
| isMalformed | back to summary |
|---|---|
| pack-priv static boolean isMalformed(byte[] bytes) Apply the correct validation for an INTEGER primitive following the BER rules.
| |
| longValue | back to summary |
|---|---|
| pack-priv static long longValue(byte[] bytes, int start, int signExt) | |
| longValueExact | back to summary |
|---|---|
| public long longValueExact() | |
| signBytesToSkip | back to summary |
|---|---|
| pack-priv static int signBytesToSkip(byte[] bytes) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |