public abstract class ASN1TaggedObject extends ASN1Primitive implements ASN1TaggedObjectParser
| Constructor and Description |
|---|
ASN1TaggedObject(boolean explicit,
int tagNo,
ASN1Encodable obj)
Create a tagged object with the style given by the value of explicit.
|
| Modifier and Type | Method and Description |
|---|---|
static ASN1TaggedObject |
getInstance(ASN1TaggedObject obj,
boolean explicit) |
static ASN1TaggedObject |
getInstance(Object obj) |
ASN1Primitive |
getLoadedObject()
Get the in-memory representation of the ASN.1 object.
|
ASN1Primitive |
getObject()
return whatever was following the tag.
|
ASN1Encodable |
getObjectParser(int tag,
boolean isExplicit)
Return the object held in this tagged object as a parser assuming it has
the type of the passed in tag.
|
int |
getTagNo() |
int |
hashCode()
Returns an integer hash code for this object.
|
boolean |
isEmpty() |
boolean |
isExplicit()
return whether or not the object may be explicitly tagged.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
equals, fromByteArray, toASN1PrimitivegetEncoded, getEncoded, hasEncodedTagValue, toASN1Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waittoASN1Primitivepublic ASN1TaggedObject(boolean explicit,
int tagNo,
ASN1Encodable obj)
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.public static ASN1TaggedObject getInstance(ASN1TaggedObject obj, boolean explicit)
public static ASN1TaggedObject getInstance(Object obj)
public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class ASN1PrimitiveObject.equals(java.lang.Object)public int getTagNo()
getTagNo in interface ASN1TaggedObjectParserpublic 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 ASN1Primitive 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.
public ASN1Encodable getObjectParser(int tag, boolean isExplicit)
getObjectParser in interface ASN1TaggedObjectParserpublic ASN1Primitive getLoadedObject()
InMemoryRepresentablegetLoadedObject in interface InMemoryRepresentablepublic String toString()
ObjectgetClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString method
if you intend implementing your own toString method.