Class DERSequenceGenerator


public class DERSequenceGenerator extends DERGenerator
A stream generator for DER SEQUENCEs
  • Constructor Details

    • DERSequenceGenerator

      public DERSequenceGenerator(OutputStream out) throws IOException
      Use the passed in stream as the target for the generator.
      Parameters:
      out - target stream
      Throws:
      IOException - if the target stream cannot be written to.
    • DERSequenceGenerator

      public DERSequenceGenerator(OutputStream out, int tagNo, boolean isExplicit) throws IOException
      Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed SEQUENCE (possibly implicit).
      Parameters:
      out - target stream
      tagNo - the tag number to introduce
      isExplicit - true if this is an explicitly tagged object, false otherwise.
      Throws:
      IOException - if the target stream cannot be written to.
  • Method Details

    • addObject

      public void addObject(ASN1Encodable object) throws IOException
      Add an object to the SEQUENCE being generated.
      Parameters:
      object - an ASN.1 encodable object to add.
      Throws:
      IOException - if the target stream cannot be written to or the object cannot be encoded.
    • addObject

      public void addObject(ASN1Primitive primitive) throws IOException
      Add an ASN1.1 primitive to the SEQUENCE being generated.
      Parameters:
      primitive - an ASN.1 primitive to add.
      Throws:
      IOException - if the target stream cannot be written to or the primitive cannot be encoded.
    • getRawOutputStream

      public OutputStream getRawOutputStream()
      Return the target stream for the SEQUENCE.
      Specified by:
      getRawOutputStream in class ASN1Generator
      Returns:
      the OutputStream the SEQUENCE is being written to.
    • close

      public void close() throws IOException
      Close of the generator, writing out the SEQUENCE.
      Throws:
      IOException - if the target stream cannot be written.