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 ClassesModifier and TypeClassDescriptionstatic class//////////////////////////////////////////////////////////////////// -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]static final Formprivate static final longstatic final Tagprivate static final INTEGER.TemplateFields inherited from class BigInteger
ONE, TEN, TWO, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanarraysEqual(byte[] bytes, int[] ints) byte[]encode()voidencode(OutputStream outStream) Write this value's DER encoding to an output stream using its own base tag.voidencode(Tag implicitTag, OutputStream outStream) Write this value's DER encoding to an output stream using an implicit tag.longprivate byte[]private ASN1HeadergetTag()Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static ASN1Templatestatic voidTests the DER encoding and decoding of the INTEGER class.Methods inherited from class 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, xorMethods inherited from class 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
-
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using its own base tag.- Specified by:
encodein interfaceASN1Value- Parameters:
outStream- Output stream.- Throws:
IOException- If an error occurred.
-
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using an implicit tag.- Specified by:
encodein 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)
-