public abstract class ASN1TaggedObject extends ASN1Primitive implements ASN1TaggedObjectParser
| Modifier | Constructor and Description |
|---|---|
protected |
ASN1TaggedObject(boolean explicit,
int tagNo,
ASN1Encodable obj)
Create a tagged object with the style given by the value of explicit.
|
protected |
ASN1TaggedObject(boolean explicit,
int tagClass,
int tagNo,
ASN1Encodable obj) |
| Modifier and Type | Method and Description |
|---|---|
ASN1Object |
getBaseObject()
Needed for open types, until we have better type-guided parsing support.
|
ASN1Primitive |
getBaseUniversal(boolean declaredExplicit,
int tagNo)
Note: tagged objects are generally context dependent.
|
ASN1Object |
getExplicitBaseObject()
Needed for open types, until we have better type-guided parsing support.
|
ASN1TaggedObject |
getExplicitBaseTagged() |
ASN1TaggedObject |
getImplicitBaseTagged(int baseTagClass,
int baseTagNo) |
static ASN1TaggedObject |
getInstance(ASN1TaggedObject taggedObject,
boolean declaredExplicit) |
static ASN1TaggedObject |
getInstance(ASN1TaggedObject taggedObject,
int tagClass,
boolean declaredExplicit) |
static ASN1TaggedObject |
getInstance(ASN1TaggedObject taggedObject,
int tagClass,
int tagNo,
boolean declaredExplicit) |
static ASN1TaggedObject |
getInstance(java.lang.Object obj) |
static ASN1TaggedObject |
getInstance(java.lang.Object obj,
int tagClass) |
static ASN1TaggedObject |
getInstance(java.lang.Object obj,
int tagClass,
int tagNo) |
ASN1Primitive |
getLoadedObject()
Get the in-memory representation of the ASN.1 object.
|
static ASN1TaggedObject |
getOptional(ASN1Encodable element) |
static ASN1TaggedObject |
getOptional(ASN1Encodable element,
int tagClass) |
static ASN1TaggedObject |
getOptional(ASN1Encodable element,
int tagClass,
int tagNo) |
int |
getTagClass()
Return the tag class associated with this object.
|
int |
getTagNo()
Return the tag number associated with this object.
|
boolean |
hasContextTag() |
boolean |
hasContextTag(int tagNo) |
int |
hashCode() |
boolean |
hasTag(int tagClass,
int tagNo) |
boolean |
hasTagClass(int tagClass) |
boolean |
isExplicit()
return whether or not the object may be explicitly tagged.
|
ASN1Encodable |
parseBaseUniversal(boolean declaredExplicit,
int baseTagNo) |
ASN1Encodable |
parseExplicitBaseObject()
Needed for open types, until we have better type-guided parsing support.
|
ASN1TaggedObjectParser |
parseExplicitBaseTagged() |
ASN1TaggedObjectParser |
parseImplicitBaseTagged(int baseTagClass,
int baseTagNo) |
java.lang.String |
toString() |
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1PrimitivegetEncoded, getEncoded, hasEncodedTagValueclone, finalize, getClass, notify, notifyAll, wait, wait, waittoASN1Primitiveprotected 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.protected ASN1TaggedObject(boolean explicit,
int tagClass,
int tagNo,
ASN1Encodable obj)
public static ASN1TaggedObject getInstance(java.lang.Object obj)
public static ASN1TaggedObject getInstance(java.lang.Object obj, int tagClass)
public static ASN1TaggedObject getInstance(java.lang.Object obj, int tagClass, int tagNo)
public static ASN1TaggedObject getInstance(ASN1TaggedObject taggedObject, boolean declaredExplicit)
public static ASN1TaggedObject getInstance(ASN1TaggedObject taggedObject, int tagClass, boolean declaredExplicit)
public static ASN1TaggedObject getInstance(ASN1TaggedObject taggedObject, int tagClass, int tagNo, boolean declaredExplicit)
public static ASN1TaggedObject getOptional(ASN1Encodable element)
public static ASN1TaggedObject getOptional(ASN1Encodable element, int tagClass)
public static ASN1TaggedObject getOptional(ASN1Encodable element, int tagClass, int tagNo)
public int hashCode()
hashCode in class ASN1Primitivepublic int getTagClass()
ASN1TaggedObjectParsergetTagClass in interface ASN1TaggedObjectParserpublic int getTagNo()
getTagNo in interface ASN1TaggedObjectParserpublic boolean hasContextTag()
hasContextTag in interface ASN1TaggedObjectParserpublic boolean hasContextTag(int tagNo)
hasContextTag in interface ASN1TaggedObjectParserpublic boolean hasTag(int tagClass,
int tagNo)
hasTag in interface ASN1TaggedObjectParserpublic boolean hasTagClass(int tagClass)
hasTagClass 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 ASN1Object getBaseObject()
getExplicitBaseTagged(), getImplicitBaseTagged(int, int) or
getBaseUniversal(boolean, int) where possible. Before using, check for matching tag
class and number.public ASN1Object getExplicitBaseObject()
getExplicitBaseTagged() or
getBaseUniversal(boolean, int) where possible. Before using, check
for matching tag class and number.public ASN1TaggedObject getExplicitBaseTagged()
public ASN1TaggedObject getImplicitBaseTagged(int baseTagClass, int baseTagNo)
public ASN1Primitive getBaseUniversal(boolean declaredExplicit, int tagNo)
tag class and tag number match
what you are looking for.declaredExplicit - Whether the tagged type for this object was declared
EXPLICIT.tagNo - The universal tag number of the
expected base object.public ASN1Encodable parseBaseUniversal(boolean declaredExplicit, int baseTagNo) throws java.io.IOException
parseBaseUniversal in interface ASN1TaggedObjectParserjava.io.IOExceptionpublic ASN1Encodable parseExplicitBaseObject() throws java.io.IOException
ASN1TaggedObjectParserASN1TaggedObjectParser.parseExplicitBaseTagged() or ASN1TaggedObjectParser.parseBaseUniversal(boolean, int)
where possible. Before using, check for matching tag class and
number.parseExplicitBaseObject in interface ASN1TaggedObjectParserjava.io.IOExceptionpublic ASN1TaggedObjectParser parseExplicitBaseTagged() throws java.io.IOException
parseExplicitBaseTagged in interface ASN1TaggedObjectParserjava.io.IOExceptionpublic ASN1TaggedObjectParser parseImplicitBaseTagged(int baseTagClass, int baseTagNo) throws java.io.IOException
parseImplicitBaseTagged in interface ASN1TaggedObjectParserjava.io.IOExceptionpublic final ASN1Primitive getLoadedObject()
InMemoryRepresentablegetLoadedObject in interface InMemoryRepresentablepublic java.lang.String toString()
toString in class java.lang.Object