APPLICATION
public static final int APPLICATION
- 64
BIT_STRING
public static final int BIT_STRING
- 3
BOOLEAN
public static final int BOOLEAN
- 1
CONTEXT
public static final int CONTEXT
- 128
IA5_STRING
public static final int IA5_STRING
- 22
INTEGER
public static final int INTEGER
- 2
NULL
public static final int NULL
- 5
OBJECT_IDENTIFIER
public static final int OBJECT_IDENTIFIER
- 6
OCTET_STRING
public static final int OCTET_STRING
- 4
PRINT_STRING
public static final int PRINT_STRING
- 19
PRIVATE
public static final int PRIVATE
- 192
SEQUENCE
public static final int SEQUENCE
- 16
SEQUENCE_OF
public static final int SEQUENCE_OF
- 48
SET
public static final int SET
- 17
SET_OF
public static final int SET_OF
- 49
T61_STRING
public static final int T61_STRING
- 20
UNIVERSAL
public static final int UNIVERSAL
- 0
UTC_TIME
public static final int UTC_TIME
- 23
clazz
(package private) int clazz
constructed
(package private) boolean constructed
explicit
(package private) boolean explicit
value
(package private) int value
Tag
(package private) Tag(int value,
boolean explicit)
Convenience constructor. Constructs an ASN.1 Tag instance.
value
- The tag's value.explicit
- Whether this tag is explicit or implicit.
Tag
(package private) Tag(int clazz,
int value,
boolean explicit)
Convenience constructor. Constructs an ASN.1 Tag instance.
clazz
- The tag's class, default is UNIVERSAL.value
- The tag's value.explicit
- Whether this tag is explicit or implicit.
Tag
(package private) Tag(int clazz,
int value,
boolean explicit,
boolean constructed)
Constructs an ASN.1 Tag instance.
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.
decode
public static Tag decode(InputStream in)
throws IOException
Constructs a Tag
instance from the designated
input stream.
in
- The input stream.
- A
Tag
instance parsed from an input
stream.
getClazz
public int getClazz()
Returns the tag's class.
getExpectedTag
public static Tag getExpectedTag(Tag tag,
InputStream in)
throws IOException
Convenience method similar to the method with same name and 3
arguments, except it uses the given tag's class and value.
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.
- An instance of the
Tag
class containing
the concrete Tag
instance found in the
input stream.
getExpectedTag
public static Tag getExpectedTag(int expectedValue,
InputStream in)
throws IOException
Convenience method similar to the method with same name and 3
arguments, except it assumes that the tag's class is UNIVERSAL.
expectedValue
- The tag's number expected to be found at
the current marker location of the given input stream.in
- The input source stream.
- An instance of the
Tag
class containing
the concrete Tag
instance found in the
input stream.
getExpectedTag
public static Tag getExpectedTag(int expectedClass,
int expectedValue,
InputStream in)
throws IOException
Returns the tag element of an ASN.1 object if it is of the
designated expected class and type, or null otherwise. If the
stream does not contain the expected tag (of given type) this
method ensures that the stream marker is not modified.
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.
- An instance of the
Tag
class containing
the concrete Tag
instance found in the
input stream.
getTag
public static byte[] getTag(InputStream in)
throws IOException
Get a tag off the wire as a byte[]
in
- The input stream
- a
byte
with the tag bytes
getValue
public int getValue()
Returns the tag's class number.
isConstructed
public boolean isConstructed()
Returns true if the tag is constructed false otherwise.
isExplicit
public boolean isExplicit()
Returns true if the tag is explicit, false otherwise.
peek
public static Tag peek(InputStream in)
throws IOException
Returns the Tag instance parsed from the given input stream,
if one is there, without modifying the stram marker.
in
- The input stream.
- A
Tag
instance parsed from the designated
input stream.
toString
public String toString()