|
For the latest news and information visit The GNU Crypto project |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.crypto.der.DERReader
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.
Field Summary |
---|
Fields inherited from interface gnu.crypto.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 |
Constructor Summary | |
---|---|
DERReader(byte[] in)
Create a new DER reader from a byte array. |
|
DERReader(byte[] in,
int off,
int len)
|
|
DERReader(InputStream in)
Create a new DER readed from an input stream. |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DERReader(byte[] in)
in
- The encoded bytes.public DERReader(byte[] in, int off, int len)
public DERReader(InputStream in)
in
- The encoded bytes.Method Detail |
---|
public static DERValue read(byte[] encoded) throws IOException
encoded
- The encoded bytes.
IOException
- If the bytes do not represent an encoded
object.public void skip(int bytes) throws IOException
IOException
public DERValue read() throws IOException
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.
IOException
- If an error occurs reading from the input
stream.
DEREncodingException
- If the input does not represent a
valid DER stream.
|
For the latest news and information visit The GNU Crypto project |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |