org.bouncycastle.asn1

Class ASN1InputStream

public class ASN1InputStream extends FilterInputStream implements DERTags

a general purpose ASN.1 decoder - note: this class differs from the others in that it returns null after it has read the last object in the stream. If an ASN.1 NULL is encountered a DER/BER Null object is returned.
Constructor Summary
ASN1InputStream(InputStream is)
ASN1InputStream(byte[] input)
Create an ASN1InputStream based on the input byte array.
ASN1InputStream(InputStream input, int limit)
Create an ASN1InputStream where no DER object will be longer than limit.
Method Summary
protected DERObjectbuildObject(int tag, int tagNo, byte[] bytes)
build an object given its tag and a byte stream to construct it from.
protected voidreadFully(byte[] bytes)
protected intreadLength()
DERObjectreadObject()

Constructor Detail

ASN1InputStream

public ASN1InputStream(InputStream is)

ASN1InputStream

public ASN1InputStream(byte[] input)
Create an ASN1InputStream based on the input byte array. The length of DER objects in the stream is automatically limited to the length of the input array.

Parameters: input array containing ASN.1 encoded data.

ASN1InputStream

public ASN1InputStream(InputStream input, int limit)
Create an ASN1InputStream where no DER object will be longer than limit.

Parameters: input stream containing ASN.1 encoded data. limit maximum size of a DER encoded object.

Method Detail

buildObject

protected DERObject buildObject(int tag, int tagNo, byte[] bytes)
build an object given its tag and a byte stream to construct it from.

readFully

protected void readFully(byte[] bytes)

readLength

protected int readLength()

readObject

public DERObject readObject()