* rules (as with sequences).
*/
public class DERTaggedObject
- extends DERObject
+ extends ASN1TaggedObject
{
- int tagNo;
- boolean empty = false;
- boolean explicit = true;
- DEREncodable obj = null;
-
- /**
- * This creates an empty tagged object of tagNo (ie. zero length).
- *
- * @param tagNo the tag number for this object.
- */
- public DERTaggedObject(
- int tagNo)
- {
- this.explicit = true;
- this.tagNo = tagNo;
- this.empty = true;
- }
-
/**
* @param tagNo the tag number for this object.
* @param obj the tagged object.
int tagNo,
DEREncodable obj)
{
- this.explicit = true;
- this.tagNo = tagNo;
- this.obj = obj;
+ super(tagNo, obj);
}
/**
- * @param explicit true if the object is explicitly tagged.
+ * @param explicit true if an explicitly tagged object.
* @param tagNo the tag number for this object.
* @param obj the tagged object.
*/
int tagNo,
DEREncodable obj)
{
- this.explicit = explicit;
- this.tagNo = tagNo;
- this.obj = obj;
- }
-
- public int getTagNo()
- {
- return tagNo;
- }
-
- public boolean isExplicit()
- {
- return explicit;
- }
-
- public boolean isEmpty()
- {
- return empty;
+ super(explicit, tagNo, obj);
}
- public DERObject getObject()
+ /**
+ * create an implicitly tagged object that contains a zero
+ * length sequence.
+ */
+ public DERTaggedObject(
+ int tagNo)
{
- return obj.getDERObject();
+ super(false, tagNo, new DERSequence());
}
void encode(
if (explicit)
{
- out.writeEncoded(CONSTRUCTED | TAGGED | tagNo, bOut.toByteArray());
+ out.writeEncoded(CONSTRUCTED | TAGGED | tagNo, bytes);
}
else
{