gnu.crypto.der
Class DERReader
- DER
public final class DERReader
This class decodes DER sequences into Java objects. The methods of
this class do not have knowledge of higher-levels of structure in the
DER stream -- such as ASN.1 constructions -- and it is therefore up
to the calling application to determine if the data are structured
properly by inspecting the
DERValue
that is returned.
- Casey Marshall (rsdio@metastatic.org)
ANY , APPLICATION , BIT_STRING , BMP_STRING , BOOLEAN , CONSTRUCTED , CONSTRUCTED_VALUE , CONTEXT , ENUMERATED , GENERALIZED_TIME , GENERAL_STRING , GRAPHIC_STRING , IA5_STRING , INTEGER , ISO646_STRING , NULL , NUMERIC_STRING , OBJECT_IDENTIFIER , OCTET_STRING , PRINTABLE_STRING , PRIVATE , REAL , RELATIVE_OID , SEQUENCE , SET , T61_STRING , UNIVERSAL , UNIVERSAL_STRING , UTC_TIME , UTF8_STRING , VIDEOTEX_STRING |
DERReader(InputStream in) - Create a new DER readed from an input stream.
|
DERReader(byte[] in) - Create a new DER reader from a byte array.
|
DERReader(byte[] in, int off, int len)
|
DERValue | read() - Decode a single value from the input stream, returning it in a new
DERValue .
|
static DERValue | read(byte[] encoded) - Convenience method for reading a single primitive value from the
given byte array.
|
void | skip(int bytes)
|
DERReader
public DERReader(InputStream in)
Create a new DER readed from an input stream.
DERReader
public DERReader(byte[] in)
Create a new DER reader from a byte array.
DERReader
public DERReader(byte[] in,
int off,
int len)
read
public DERValue read()
throws IOException
Decode a single value from the input stream, returning it in a new
DERValue
. By "single value" we mean any single type in its
entirety -- including constructed types such as SEQUENCE and all
the values they contain. Usually it is sufficient to call this
method once to parse and return the top-level structure, then to
inspect the returned value for the proper contents.
- The parsed DER structure.
read
public static DERValue read(byte[] encoded)
throws IOException
Convenience method for reading a single primitive value from the
given byte array.
encoded
- The encoded bytes.
skip
public void skip(int bytes)
throws IOException
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.