Class EXPLICIT

  • All Implemented Interfaces:
    ASN1Value

    public class EXPLICIT
    extends java.lang.Object
    implements ASN1Value
    An explicit tag.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  EXPLICIT.Template
      A template for decoding an object wrapped in an EXPLICIT tag.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Form FORM  
    • Constructor Summary

      Constructors 
      Constructor Description
      EXPLICIT​(Tag tag, ASN1Value content)
      Creates an EXPLICIT tag wrapping some other ASN1Value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void encode​(java.io.OutputStream ostream)
      Write this value's DER encoding to an output stream using its own base tag.
      void encode​(Tag implicitTag, java.io.OutputStream ostream)
      Write this value's DER encoding to an output stream using an implicit tag.
      ASN1Value getContent()  
      Tag getTag()
      Returns the Tag of this EXPLICIT tag.
      static EXPLICIT.Template getTemplate​(Tag tag, ASN1Template content)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FORM

        public static final Form FORM
    • Constructor Detail

      • EXPLICIT

        public EXPLICIT​(Tag tag,
                        ASN1Value content)
        Creates an EXPLICIT tag wrapping some other ASN1Value. For example, for the following ASN.1 snippet:
         MyType [3] EXPLICIT INTEGER
         
        assuming a sample value of 5 for the INTEGER, a MyType could be created with:
          EXPLICIT myValue = new EXPLICIT( new Tag(3), new INTEGER(5) );
         
        Parameters:
        tag - Tag.
        content - Content.
    • Method Detail

      • getContent

        public ASN1Value getContent()
        Returns:
        the ASN1Value that is wrapped by this EXPLICIT tag.
      • getTag

        public Tag getTag()
        Returns the Tag of this EXPLICIT tag.
        Specified by:
        getTag in interface ASN1Value
        Returns:
        Base tag.
      • encode

        public void encode​(java.io.OutputStream ostream)
                    throws java.io.IOException
        Description copied from interface: ASN1Value
        Write this value's DER encoding to an output stream using its own base tag.
        Specified by:
        encode in interface ASN1Value
        Parameters:
        ostream - Output stream.
        Throws:
        java.io.IOException - If an error occurred.
      • encode

        public void encode​(Tag implicitTag,
                           java.io.OutputStream ostream)
                    throws java.io.IOException
        Description copied from interface: ASN1Value
        Write this value's DER encoding to an output stream using an implicit tag.
        Specified by:
        encode in interface ASN1Value
        Parameters:
        implicitTag - Implicit tag.
        ostream - Output stream.
        Throws:
        java.io.IOException - If an error occurred.