X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fbouncycastle%2Fasn1%2FDERTaggedObject.java;fp=src%2Forg%2Fbouncycastle%2Fasn1%2FDERTaggedObject.java;h=ba6941211d47ad8dd60defe6e327aae85a75824b;hb=d70f271afd972a3bdeba9ee54b1e9a3334e6fe4b;hp=4ec03105c4b300b541c206a0718831f8cbe736fb;hpb=3f13b8f2e9c92b428dc237327f3e86353902ac29;p=org.ibex.core.git diff --git a/src/org/bouncycastle/asn1/DERTaggedObject.java b/src/org/bouncycastle/asn1/DERTaggedObject.java index 4ec0310..ba69412 100644 --- a/src/org/bouncycastle/asn1/DERTaggedObject.java +++ b/src/org/bouncycastle/asn1/DERTaggedObject.java @@ -8,26 +8,8 @@ import java.io.*; * 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. @@ -36,13 +18,11 @@ public class DERTaggedObject 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. */ @@ -51,29 +31,17 @@ public class DERTaggedObject 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( @@ -92,7 +60,7 @@ public class DERTaggedObject if (explicit) { - out.writeEncoded(CONSTRUCTED | TAGGED | tagNo, bOut.toByteArray()); + out.writeEncoded(CONSTRUCTED | TAGGED | tagNo, bytes); } else {