Class ASN1InputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.bouncycastle.asn1.ASN1InputStream
All Implemented Interfaces:
Closeable, AutoCloseable, BERTags

public class ASN1InputStream
extends FilterInputStream
implements BERTags
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 Details

    • 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​(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.
    • 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.
    • ASN1InputStream

      public ASN1InputStream​(InputStream input, 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.
      lazyEvaluate - true if parsing inside constructed objects can be delayed.
    • ASN1InputStream

      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.
  • Method Details