org.mozilla.jss.asn1

Class INTEGER

Implemented Interfaces:
ASN1Value
Known Direct Subclasses:
ENUMERATED

public class INTEGER
extends BigInteger
implements ASN1Value

The ASN.1 type INTEGER. This class extends BigInteger.

Nested Class Summary

static class
INTEGER.Template

Field Summary

static Form
FORM
static Tag
TAG

Constructor Summary

INTEGER(BigInteger bi)
INTEGER(String s)
INTEGER(String s, int r)
INTEGER(byte[] bval)
INTEGER(int numBits, Random rnd)
INTEGER(int sign, byte[] mag)
INTEGER(int bitLength, int certainty, Random rnd)
INTEGER(long val)

Method Summary

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
getContentLength()
Tag
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
static ASN1Template
getTemplate()
static void
main(args[] )
Tests the DER encoding and decoding of the INTEGER class.

Field Details

FORM

public static final Form FORM

TAG

public static final Tag TAG

Constructor Details

INTEGER

public INTEGER(BigInteger bi)

INTEGER

public INTEGER(String s)
            throws NumberFormatException

INTEGER

public INTEGER(String s,
               int r)
            throws NumberFormatException

INTEGER

public INTEGER(byte[] bval)
            throws NumberFormatException

INTEGER

public INTEGER(int numBits,
               Random rnd)
            throws NumberFormatException

INTEGER

public INTEGER(int sign,
               byte[] mag)
            throws NumberFormatException

INTEGER

public INTEGER(int bitLength,
               int certainty,
               Random rnd)

INTEGER

public INTEGER(long val)

Method Details

encode

public byte[] encode()
            throws IOException

encode

public void encode(OutputStream outStream)
            throws IOException
Write this value's DER encoding to an output stream using its own base tag.
Specified by:
encode in interface ASN1Value

encode

public void encode(Tag implicitTag,
                   OutputStream outStream)
            throws IOException
Write this value's DER encoding to an output stream using an implicit tag.
Specified by:
encode in interface ASN1Value

getContentLength

public long getContentLength()

getTag

public Tag getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
Specified by:
getTag in interface ASN1Value

getTemplate

public static ASN1Template getTemplate()

main

public static void main(args[] )
Tests the DER encoding and decoding of the INTEGER class.