Package org.mozilla.jss.asn1
Class Tag
java.lang.Object
org.mozilla.jss.asn1.Tag
Represents an ASN.1 Tag. A tag consists of a class and a number.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Tag.Class
A tag class.static final Tag.Class
A tag class.static final Tag
The end-of-contents marker for indefinite length encoding.static final Tag
An alias for END_OF_CONTENTS.private long
private static final int
static final Tag.Class
A tag class.private static Tag[]
private Tag.Class
static final Tag.Class
A tag class. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
num
private long num -
tClass
-
UNIVERSAL
A tag class. -
APPLICATION
A tag class. -
CONTEXT_SPECIFIC
A tag class. -
PRIVATE
A tag class. -
END_OF_CONTENTS
The end-of-contents marker for indefinite length encoding. It is encoded the same as an ASN.1 header whose tag is [UNIVERSAL 0]. -
EOC
An alias for END_OF_CONTENTS. -
numTagInstances
private static final int numTagInstances- See Also:
-
tagInstances
-
-
Constructor Details
-
Tag
Creates a tag with the given class and number.- Parameters:
clazz
- The class of the tag.num
- The tag number.
-
Tag
public Tag(long num) Creates a CONTEXT-SPECIFIC tag with the given tag number.- Parameters:
num
- The tag number.
-
-
Method Details
-
getNum
public long getNum()- Returns:
- The tag number.
-
getTagClass
- Returns:
- The tag class.
-
get
Returns an instance of a context-specific tag with the given number. The returned instance may be singleton. It is usually more efficient to call this method than create your own context-specific tag.- Parameters:
num
- Number.- Returns:
- Tag.
-
hashCode
public int hashCode() -
equals
Compares two tags for equality. Tags are equal if they have the same class and tag number. -
toString
Returns a String representation of the tag. For example, a tag whose class was UNIVERSAL and whose number was 16 would return "UNIVERSAL 16".
-