org.mozilla.jss.asn1

Class ASN1Util


public class ASN1Util
extends java.lang.Object

Method Summary

static ASN1Value
decode(ASN1Template template, byte[] encoded)
static ASN1Value
decode(Tag implicitTag, ASN1Template template, byte[] encoded)
static byte[]
encode(ASN1Value val)
static byte[]
encode(Tag implicitTag, ASN1Value val)
static void
readFully(byte[] bytes, InputStream istream)
Fills a byte array with bytes from an input stream.

Method Details

decode

public static ASN1Value decode(ASN1Template template,
                               byte[] encoded)
            throws InvalidBERException


decode

public static ASN1Value decode(Tag implicitTag,
                               ASN1Template template,
                               byte[] encoded)
            throws InvalidBERException


encode

public static byte[] encode(ASN1Value val)


encode

public static byte[] encode(Tag implicitTag,
                            ASN1Value val)


readFully

public static void readFully(byte[] bytes,
                             InputStream istream)
            throws IOException
Fills a byte array with bytes from an input stream. This method keeps reading until the array is filled, an IOException occurs, or EOF is reached. The byte array will be completely filled unless an exception is thrown.

Parameters:
bytes - A byte array which will be filled up.
istream - The input stream from which to read the bytes.