Class ASN1Primitive

    • Method Detail

      • encodeTo

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

        public void encodeTo​(java.io.OutputStream output,
                             java.lang.String encoding)
                      throws java.io.IOException
        Overrides:
        encodeTo in class ASN1Object
        Throws:
        java.io.IOException
      • fromByteArray

        public static ASN1Primitive fromByteArray​(byte[] data)
                                           throws java.io.IOException
        Parse an ASN.1 (BER) encoding from a byte array. Checks there are no extra bytes following the encoding.
        Parameters:
        data - the byte array to parse.
        Returns:
        the base ASN.1 object parsed from the byte array.
        Throws:
        java.io.IOException - if there is a problem parsing the data, or parsing did not exhaust the available data.
      • fromStream

        public static ASN1Primitive fromStream​(java.io.InputStream input)
                                        throws java.io.IOException
        Parse the first ASN.1 (BER) encoding from an InputStream.The stream is not closed by this method and may contain further data beyond the first ASN.1 encoding.
        Parameters:
        data - the stream to parse.
        Returns:
        the base ASN.1 object parsed from the stream.
        Throws:
        java.io.IOException - if there is a problem parsing the data.
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class ASN1Object