|
Bouncy Castle Cryptography Library 1.77.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.asn1.ASN1Object | +--org.bouncycastle.asn1.ASN1Primitive | +--org.bouncycastle.asn1.ASN1TaggedObject
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).
Constructor Summary | |
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)
|
Method Summary | |
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(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. |
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()
|
Methods inherited from class org.bouncycastle.asn1.ASN1Primitive |
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive |
Methods inherited from class org.bouncycastle.asn1.ASN1Object |
getEncoded, getEncoded, hasEncodedTagValue |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.bouncycastle.asn1.ASN1Encodable |
toASN1Primitive |
Constructor Detail |
protected 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)
Method Detail |
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 int hashCode()
hashCode
in class ASN1Primitive
public int getTagClass()
ASN1TaggedObjectParser
getTagClass
in interface ASN1TaggedObjectParser
org.bouncycastle.asn1.ASN1TaggedObjectParser
public int getTagNo()
getTagNo
in interface ASN1TaggedObjectParser
public boolean hasContextTag()
hasContextTag
in interface ASN1TaggedObjectParser
public boolean hasContextTag(int tagNo)
hasContextTag
in interface ASN1TaggedObjectParser
public boolean hasTag(int tagClass, int tagNo)
hasTag
in interface ASN1TaggedObjectParser
public boolean hasTagClass(int tagClass)
hasTagClass
in interface ASN1TaggedObjectParser
public 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 ASN1TaggedObjectParser
public ASN1Encodable parseExplicitBaseObject() throws java.io.IOException
ASN1TaggedObjectParser
ASN1TaggedObjectParser.parseExplicitBaseTagged()
or ASN1TaggedObjectParser.parseBaseUniversal(boolean, int)
where possible. Before using, check for matching tag class
and
number
.parseExplicitBaseObject
in interface ASN1TaggedObjectParser
public ASN1TaggedObjectParser parseExplicitBaseTagged() throws java.io.IOException
parseExplicitBaseTagged
in interface ASN1TaggedObjectParser
public ASN1TaggedObjectParser parseImplicitBaseTagged(int baseTagClass, int baseTagNo) throws java.io.IOException
parseImplicitBaseTagged
in interface ASN1TaggedObjectParser
public final ASN1Primitive getLoadedObject()
InMemoryRepresentable
getLoadedObject
in interface InMemoryRepresentable
org.bouncycastle.asn1.InMemoryRepresentable
java.io.IOException
- for bad input data.public java.lang.String toString()
toString
in class java.lang.Object
|
Bouncy Castle Cryptography Library 1.77.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |