Class ASN1TaggedObject
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.asn1.ASN1Encodable,io.anyline.nfc.bouncycastle.asn1.ASN1TaggedObjectParser,io.anyline.nfc.bouncycastle.asn1.InMemoryRepresentable,io.anyline.nfc.bouncycastle.util.Encodable
public abstract class ASN1TaggedObject extends ASN1Primitive implements ASN1TaggedObjectParser
ASN.1 TaggedObject - in ASN.1 notation this is any object preceded by a [n] where n is some number - these are assumed to follow the construction rules (as with sequences).
-
-
Method Summary
Modifier and Type Method Description intgetTagClass()Return the tag class associated with this object. intgetTagNo()Return the tag number associated with this object. static ASN1TaggedObjectgetInstance(ASN1TaggedObject obj, boolean explicit)static ASN1TaggedObjectgetInstance(Object obj)inthashCode()booleanhasContextTag(int tagNo)booleanhasTag(int tagClass, int tagNo)booleanisExplicit()return whether or not the object may be explicitly tagged. ASN1PrimitivegetObject()Return whatever was following the tag. ASN1ObjectgetExplicitBaseObject()Needed for open types, until we have better type-guided parsing support. ASN1ObjectgetExplicitContextBaseObject()ASN1TaggedObjectgetExplicitBaseTagged()ASN1TaggedObjectgetImplicitBaseTagged(int baseTagClass, int baseTagNo)ASN1PrimitivegetBaseUniversal(boolean declaredExplicit, int tagNo)Note: tagged objects are generally context dependent. ASN1EncodablegetObjectParser(int tag, boolean isExplicit)ASN1EncodableparseBaseUniversal(boolean declaredExplicit, int baseTagNo)final ASN1PrimitivegetLoadedObject()Get the in-memory representation of the ASN.1 object. StringtoString()-
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Primitive
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive -
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getTagClass
int getTagClass()
Return the tag class associated with this object.
- Returns:
the tag class.
-
getTagNo
int getTagNo()
Return the tag number associated with this object.
- Returns:
the tag number.
-
getInstance
static ASN1TaggedObject getInstance(ASN1TaggedObject obj, boolean explicit)
-
getInstance
static ASN1TaggedObject getInstance(Object obj)
-
hashCode
int hashCode()
-
hasContextTag
boolean hasContextTag(int tagNo)
-
hasTag
boolean hasTag(int tagClass, int tagNo)
-
isExplicit
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.
-
getObject
ASN1Primitive 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.
-
getExplicitBaseObject
ASN1Object getExplicitBaseObject()
Needed for open types, until we have better type-guided parsing support. Use sparingly for other purposes, and prefer getExplicitBaseTagged or getBaseUniversal where possible. Before using, check for matching tag class and number.
-
getExplicitContextBaseObject
ASN1Object getExplicitContextBaseObject()
-
getExplicitBaseTagged
ASN1TaggedObject getExplicitBaseTagged()
-
getImplicitBaseTagged
ASN1TaggedObject getImplicitBaseTagged(int baseTagClass, int baseTagNo)
-
getBaseUniversal
ASN1Primitive getBaseUniversal(boolean declaredExplicit, int tagNo)
Note: tagged objects are generally context dependent. Before trying to extract a tagged object this way, make sure you have checked that both the tag class and tag number match what you are looking for.
- Parameters:
declaredExplicit- Whether the tagged type for this object was declared EXPLICIT.tagNo- The universal tag number of the expected base object.
-
getObjectParser
ASN1Encodable getObjectParser(int tag, boolean isExplicit)
-
parseBaseUniversal
ASN1Encodable parseBaseUniversal(boolean declaredExplicit, int baseTagNo)
-
getLoadedObject
final ASN1Primitive getLoadedObject()
Get the in-memory representation of the ASN.1 object.
- Returns:
an ASN1Primitive representing the loaded object.
-
-
-
-