public class

ASN1InputStream

extends FilterInputStream
implements DERTags
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ org.bouncycastle.asn1.ASN1InputStream

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface org.bouncycastle.asn1.DERTags
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
ASN1InputStream(InputStream is)
ASN1InputStream(byte[] input)
Create an ASN1InputStream based on the input byte array.
ASN1InputStream(byte[] input, boolean lazyEvaluate)
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.
ASN1InputStream(InputStream input, int limit, boolean lazyEvaluate)
Create an ASN1InputStream where no DER object will be longer than limit, and constructed objects such as sequences will be parsed lazily.
Public Methods
DERObject readObject()
Protected Methods
DERObject buildObject(int tag, int tagNo, int length)
build an object given its tag and the number of bytes to construct it from.
void readFully(byte[] bytes)
int readLength()
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public ASN1InputStream (InputStream is)

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.

public ASN1InputStream (byte[] input, boolean lazyEvaluate)

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.
lazyEvaluate true if parsing inside constructed objects can be delayed.

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.

public ASN1InputStream (InputStream input, int limit, boolean lazyEvaluate)

Create an ASN1InputStream where no DER object will be longer than limit, and constructed objects such as sequences will be parsed lazily.

Parameters
input stream containing ASN.1 encoded data.
limit maximum size of a DER encoded object.
lazyEvaluate true if parsing inside constructed objects can be delayed.

Public Methods

public DERObject readObject ()

Throws
IOException

Protected Methods

protected DERObject buildObject (int tag, int tagNo, int length)

build an object given its tag and the number of bytes to construct it from.

Throws
IOException

protected void readFully (byte[] bytes)

Throws
IOException

protected int readLength ()

Throws
IOException