Package org.mozilla.jss.asn1
Class INTEGER
java.lang.Object
java.lang.Number
java.math.BigInteger
org.mozilla.jss.asn1.INTEGER
- All Implemented Interfaces:
Serializable
,Comparable<BigInteger>
,ASN1Value
- Direct Known Subclasses:
ENUMERATED
The ASN.1 type
INTEGER
. This class extends BigInteger.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
static final Form
private static final long
static final Tag
private static final INTEGER.Template
Fields inherited from class java.math.BigInteger
ONE, TEN, TWO, ZERO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
arraysEqual
(byte[] bytes, int[] ints) byte[]
encode()
void
encode
(OutputStream outStream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag implicitTag, OutputStream outStream) Write this value's DER encoding to an output stream using an implicit tag.long
private byte[]
private ASN1Header
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static ASN1Template
static void
Tests the DER encoding and decoding of the INTEGER class.Methods inherited from class java.math.BigInteger
abs, add, and, andNot, bitCount, bitLength, byteValueExact, clearBit, compareTo, divide, divideAndRemainder, doubleValue, equals, flipBit, floatValue, gcd, getLowestSetBit, hashCode, intValue, intValueExact, isProbablePrime, longValue, longValueExact, max, min, mod, modInverse, modPow, multiply, negate, nextProbablePrime, not, or, parallelMultiply, pow, probablePrime, remainder, setBit, shiftLeft, shiftRight, shortValueExact, signum, sqrt, sqrtAndRemainder, subtract, testBit, toByteArray, toString, toString, valueOf, xor
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
encodedContents
private byte[] encodedContents -
TAG
-
FORM
-
templateInstance
-
-
Constructor Details
-
INTEGER
- Throws:
NumberFormatException
-
INTEGER
- Throws:
NumberFormatException
-
INTEGER
- Throws:
NumberFormatException
-
INTEGER
- Throws:
NumberFormatException
-
INTEGER
- Throws:
NumberFormatException
-
INTEGER
-
INTEGER
public INTEGER(long val) -
INTEGER
-
-
Method Details
-
getEncodedContents
private byte[] getEncodedContents() -
getHeader
-
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
outStream
- Output stream.- Throws:
IOException
- If an error occurred.
-
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
implicitTag
- Implicit tag.outStream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getContentLength
public long getContentLength() -
encode
- Throws:
IOException
-
getTemplate
-
main
Tests the DER encoding and decoding of the INTEGER class.- Parameters:
args
- Arguments.
-
arraysEqual
private static boolean arraysEqual(byte[] bytes, int[] ints)
-