org.bouncycastle.asn1
Class ASN1TaggedObject
- DEREncodable, DERTags
public abstract class ASN1TaggedObject
ASN.1 TaggedObject - in ASN.1 nottation this is any object proceeded by
a [n] where n is some number - these are assume to follow the construction
rules (as with sequences).
APPLICATION , BIT_STRING , BMP_STRING , BOOLEAN , CONSTRUCTED , ENUMERATED , EXTERNAL , GENERALIZED_TIME , GENERAL_STRING , 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 |
ASN1TaggedObject
public ASN1TaggedObject(boolean explicit,
int tagNo,
DEREncodable obj)
Create a tagged object with the style given by the value of explicit.
If the object implements ASN1Choice the tag style will always be changed
to explicit in accordance with the ASN.1 encoding rules.
explicit
- true if the object is explicitly tagged.tagNo
- the tag number for this object.obj
- the tagged object.
ASN1TaggedObject
public ASN1TaggedObject(int tagNo,
DEREncodable obj)
Create a tagged object in the explicit style.
tagNo
- the tag number for this object.obj
- the tagged object.
equals
public boolean equals(Object o)
- equals in interface DERObject
getObject
public DERObject getObject()
return whatever was following the tag.
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.
getTagNo
public int getTagNo()
hashCode
public int hashCode()
- hashCode in interface DERObject
isEmpty
public boolean isEmpty()
isExplicit
public boolean isExplicit()
return whether or not the object may be explicitly tagged.
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.