public abstract class ASN1TaggedObject extends DERObject
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
empty |
(package private) boolean |
explicit |
(package private) DEREncodable |
obj |
(package private) int |
tagNo |
APPLICATION, BIT_STRING, BMP_STRING, BOOLEAN, CONSTRUCTED, ENUMERATED, EXTERNAL, GENERAL_STRING, GENERALIZED_TIME, GRAPHIC_STRING, IA5_STRING, INTEGER, NULL, NUMERIC_STRING, OBJECT_IDENTIFIER, OCTET_STRING, PRINTABLE_STRING, SEQUENCE, SEQUENCE_OF, SET, SET_OF, T61_STRING, TAGGED, UNIVERSAL_STRING, UTC_TIME, UTF8_STRING, VIDEOTEX_STRING, VISIBLE_STRING
Constructor and Description |
---|
ASN1TaggedObject(boolean explicit,
int tagNo,
DEREncodable obj) |
ASN1TaggedObject(int tagNo,
DEREncodable obj) |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
encode(DEROutputStream out) |
boolean |
equals(java.lang.Object o) |
static ASN1TaggedObject |
getInstance(ASN1TaggedObject obj,
boolean explicit) |
DERObject |
getObject()
return whatever was following the tag.
|
int |
getTagNo() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isExplicit()
return whether or not the object may be explicitly tagged.
|
getDERObject
int tagNo
boolean empty
boolean explicit
DEREncodable obj
public ASN1TaggedObject(int tagNo, DEREncodable obj)
tagNo
- the tag number for this object.obj
- the tagged object.public ASN1TaggedObject(boolean explicit, int tagNo, DEREncodable obj)
explicit
- true if the object is explicitly tagged.tagNo
- the tag number for this object.obj
- the tagged object.public static ASN1TaggedObject getInstance(ASN1TaggedObject obj, boolean explicit)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getTagNo()
public boolean isExplicit()
Note: if the object has been read from an input stream, the only time you can be sure if isExplicit is returning the true state of affairs is if it returns false. An implicitly tagged object may appear to be explicitly tagged, so you need to understand the context under which the reading was done as well, see getObject below.
public boolean isEmpty()
public DERObject getObject()
Note: tagged objects are generally context dependent if you're trying to extract a tagged object you should be going via the appropriate getInstance method.
abstract void encode(DEROutputStream out) throws java.io.IOException