Class ASN1Object

    • Constructor Summary

      Constructors 
      Constructor Description
      ASN1Object()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void encodeTo​(java.io.OutputStream output)  
      void encodeTo​(java.io.OutputStream output, java.lang.String encoding)  
      boolean equals​(java.lang.Object o)  
      byte[] getEncoded()
      Return the default BER or DER encoding for this object.
      byte[] getEncoded​(java.lang.String encoding)
      Return either the default for "BER" or a DER encoding if "DER" is specified.
      protected static boolean hasEncodedTagValue​(java.lang.Object obj, int tagValue)
      Return true if obj is a byte array and represents an object with the given tag value.
      int hashCode()  
      abstract ASN1Primitive toASN1Primitive()
      Method providing a primitive representation of this object suitable for encoding.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ASN1Object

        public ASN1Object()
    • Method Detail

      • encodeTo

        public void encodeTo​(java.io.OutputStream output)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • encodeTo

        public void encodeTo​(java.io.OutputStream output,
                             java.lang.String encoding)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getEncoded

        public byte[] getEncoded()
                          throws java.io.IOException
        Return the default BER or DER encoding for this object.
        Specified by:
        getEncoded in interface Encodable
        Returns:
        BER/DER byte encoded object.
        Throws:
        java.io.IOException - on encoding error.
      • getEncoded

        public byte[] getEncoded​(java.lang.String encoding)
                          throws java.io.IOException
        Return either the default for "BER" or a DER encoding if "DER" is specified.
        Parameters:
        encoding - name of encoding to use.
        Returns:
        byte encoded object.
        Throws:
        java.io.IOException - on encoding error.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hasEncodedTagValue

        protected static boolean hasEncodedTagValue​(java.lang.Object obj,
                                                    int tagValue)
        Return true if obj is a byte array and represents an object with the given tag value.
        Parameters:
        obj - object of interest.
        tagValue - tag value to check for.
        Returns:
        true if obj is a byte encoding starting with the given tag value, false otherwise.
      • toASN1Primitive

        public abstract ASN1Primitive toASN1Primitive()
        Method providing a primitive representation of this object suitable for encoding.
        Specified by:
        toASN1Primitive in interface ASN1Encodable
        Returns:
        a primitive representation of this object.