|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcryptix.asn1.lang.Tag
A class to handle ASN.1 Tag elements.
Copyright ©1997, 1998, 1999
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.3 $
Field Summary | |
---|---|
static int |
APPLICATION
|
static int |
BIT_STRING
|
static int |
BOOLEAN
|
(package private) int |
clazz
|
(package private) boolean |
constructed
|
static int |
CONTEXT
|
(package private) boolean |
explicit
|
static int |
IA5_STRING
|
static int |
INTEGER
|
static int |
NULL
|
static int |
OBJECT_IDENTIFIER
|
static int |
OCTET_STRING
|
static int |
PRINT_STRING
|
static int |
PRIVATE
|
static int |
SEQUENCE
|
static int |
SEQUENCE_OF
|
static int |
SET
|
static int |
SET_OF
|
static int |
T61_STRING
|
static int |
UNIVERSAL
|
static int |
UTC_TIME
|
(package private) int |
value
|
Constructor Summary | |
---|---|
(package private) |
Tag(int value,
boolean explicit)
Convenience constructor. |
(package private) |
Tag(int clazz,
int value,
boolean explicit)
Convenience constructor. |
(package private) |
Tag(int clazz,
int value,
boolean explicit,
boolean constructed)
Constructs an ASN.1 Tag instance. |
Method Summary | |
---|---|
static Tag |
decode(java.io.InputStream in)
Constructs a Tag instance from the designated
input stream. |
int |
getClazz()
Returns the tag's class. |
static Tag |
getExpectedTag(int expectedValue,
java.io.InputStream in)
Convenience method similar to the method with same name and 3 arguments, except it assumes that the tag's class is UNIVERSAL. |
static Tag |
getExpectedTag(int expectedClass,
int expectedValue,
java.io.InputStream in)
Returns the tag element of an ASN.1 object if it is of the designated expected class and type, or null otherwise. |
static Tag |
getExpectedTag(Tag tag,
java.io.InputStream in)
Convenience method similar to the method with same name and 3 arguments, except it uses the given tag's class and value. |
static byte[] |
getTag(java.io.InputStream in)
Get a tag off the wire as a byte[] |
int |
getValue()
Returns the tag's class number. |
boolean |
isConstructed()
Returns true if the tag is constructed false otherwise. |
boolean |
isExplicit()
Returns true if the tag is explicit, false otherwise. |
static Tag |
peek(java.io.InputStream in)
Returns the Tag instance parsed from the given input stream, if one is there, without modifying the stram marker. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int UNIVERSAL
public static final int APPLICATION
public static final int CONTEXT
public static final int PRIVATE
public static final int BOOLEAN
public static final int INTEGER
public static final int BIT_STRING
public static final int OCTET_STRING
public static final int NULL
public static final int OBJECT_IDENTIFIER
public static final int SEQUENCE
public static final int SEQUENCE_OF
public static final int SET
public static final int SET_OF
public static final int PRINT_STRING
public static final int T61_STRING
public static final int IA5_STRING
public static final int UTC_TIME
int clazz
int value
boolean explicit
boolean constructed
Constructor Detail |
Tag(int clazz, int value, boolean explicit, boolean constructed)
clazz
- The tag's class, default is UNIVERSAL.value
- The tag's value.explicit
- Whether this tag is explicit or implicit.constructed
- Whether this tag is constructed or not.
Default is not constrcuted.Tag(int clazz, int value, boolean explicit)
clazz
- The tag's class, default is UNIVERSAL.value
- The tag's value.explicit
- Whether this tag is explicit or implicit.Tag(int value, boolean explicit)
value
- The tag's value.explicit
- Whether this tag is explicit or implicit.Method Detail |
public int getClazz()
public int getValue()
public boolean isExplicit()
public boolean isConstructed()
public static Tag getExpectedTag(int expectedClass, int expectedValue, java.io.InputStream in) throws java.io.IOException
expectedClass
- The tag's class expected to be found at
the current marker location of the given input stream.expectedValue
- The tag's number expected to be found at
the current marker location of the given input stream.in
- The input source stream.
Tag
class containing
the concrete Tag
instance found in the
input stream.
java.io.IOException
public static Tag getExpectedTag(int expectedValue, java.io.InputStream in) throws java.io.IOException
expectedValue
- The tag's number expected to be found at
the current marker location of the given input stream.in
- The input source stream.
Tag
class containing
the concrete Tag
instance found in the
input stream.
java.io.IOException
public static Tag getExpectedTag(Tag tag, java.io.InputStream in) throws java.io.IOException
tag
- The tag's instance (class and value) expected to be
found at the current marker location of the given input
stream.in
- The input source stream.
Tag
class containing
the concrete Tag
instance found in the
input stream.
java.io.IOException
public static byte[] getTag(java.io.InputStream in) throws java.io.IOException
byte[]
in
- The input stream
byte
with the tag bytes
java.io.IOException
- --EKRpublic static Tag decode(java.io.InputStream in) throws java.io.IOException
Tag
instance from the designated
input stream.
in
- The input stream.
Tag
instance parsed from an input
stream.
java.io.IOException
- If an error occurs while parsing
the input stream.public static Tag peek(java.io.InputStream in) throws java.io.IOException
in
- The input stream.
Tag
instance parsed from the designated
input stream.
java.io.IOException
- If an error occurs while parsing
the input stream.public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |