java.lang.Object
gnu.java.security.der.DERReader
- All Implemented Interfaces:
- DER
- public class DERReader
- extends java.lang.Object
- implements DER
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.
| Fields inherited from interface gnu.java.security.der.DER |
ANY, APPLICATION, BIT_STRING, BMP_STRING, BOOLEAN, CONSTRUCTED, CONSTRUCTED_VALUE, CONTEXT, ENUMERATED, GENERAL_STRING, GENERALIZED_TIME, 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected java.io.InputStream in
encBuf
protected final java.io.ByteArrayOutputStream encBuf
DERReader
public DERReader(byte[] in)
- Create a new DER reader from a byte array.
DERReader
public DERReader(byte[] in,
int off,
int len)
DERReader
public DERReader(java.io.InputStream in)
- Create a new DER readed from an input stream.
read
public static DERValue read(byte[] encoded)
throws java.io.IOException
- Convenience method for reading a single primitive value from the
given byte array.
skip
public void skip(int bytes)
throws java.io.IOException
read
public DERValue read()
throws java.io.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.
readLength
protected int readLength()
throws java.io.IOException
readUniversal
private java.lang.Object readUniversal(int tag,
int len)
throws java.io.IOException
makeString
private static java.lang.String makeString(int tag,
byte[] value)
throws java.io.IOException
fromIso88591
private static java.lang.String fromIso88591(byte[] bytes)
fromUtf16Be
private static java.lang.String fromUtf16Be(byte[] bytes)
throws java.io.IOException
fromUtf8
private static java.lang.String fromUtf8(byte[] bytes)
throws java.io.IOException
makeTime
private java.util.Date makeTime(int tag,
byte[] value)
throws java.io.IOException