Class BERSequenceGenerator


  • public class BERSequenceGenerator
    extends BERGenerator
    A stream generator for DER SEQUENCEs
    • Constructor Summary

      Constructors 
      Constructor Description
      BERSequenceGenerator​(java.io.OutputStream out)
      Use the passed in stream as the target for the generator, writing out the header tag for a constructed SEQUENCE.
      BERSequenceGenerator​(java.io.OutputStream out, int tagNo, boolean isExplicit)
      Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed SEQUENCE (possibly implicit).
    • Constructor Detail

      • BERSequenceGenerator

        public BERSequenceGenerator​(java.io.OutputStream out)
                             throws java.io.IOException
        Use the passed in stream as the target for the generator, writing out the header tag for a constructed SEQUENCE.
        Parameters:
        out - target stream
        Throws:
        java.io.IOException - if the target stream cannot be written to.
      • BERSequenceGenerator

        public BERSequenceGenerator​(java.io.OutputStream out,
                                    int tagNo,
                                    boolean isExplicit)
                             throws java.io.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:
        java.io.IOException - if the target stream cannot be written to.
    • Method Detail

      • addObject

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

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