Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jss.asn1
Class Tag

    java.lang.Object
      |
      +--org.mozilla.jss.asn1.Tag

public class Tag
extends java.lang.Object

Represents an ASN.1 Tag. A tag consists of a class and a number.

Nested Class Summary
`static class` | `Tag.Class` An enumeration of the ASN.1 tag classes.

Field Summary
`static Tag.Class` | `APPLICATION` A tag class.
`static Tag.Class` | `CONTEXT_SPECIFIC` A tag class.
`static Tag` | `END_OF_CONTENTS` The end-of-contents marker for indefinite length encoding.
`static Tag` | `EOC` An alias for END_OF_CONTENTS.
`private long` | `num`
`private static int` | `numTagInstances`
`static Tag.Class` | `PRIVATE` A tag class.
`private static Tag[]` | `tagInstances`
`private Tag.Class` | `tClass`
`static Tag.Class` | `UNIVERSAL` A tag class.

Constructor Summary
`private` | `Tag()`
`` | `Tag(long num)` Creates a CONTEXT-SPECIFIC tag with the given tag number.
`` | `Tag(Tag.Class clazz, long num)` Creates a tag with the given class and number.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Compares two tags for equality.
`static Tag` | `get(long num)` Returns an instance of a context-specific tag with the given number.
`long` | `getNum()` Returns the tag number.
`Tag.Class` | `getTagClass()` Returns the tag class.
`int` | `hashCode()`
`java.lang.String` | `toString()` Returns a String representation of the tag.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### num

    private long num

### tClass

    private Tag.Class tClass

### UNIVERSAL

    public static final Tag.Class UNIVERSAL

  A tag class.

### APPLICATION

    public static final Tag.Class APPLICATION

  A tag class.

### CONTEXT_SPECIFIC

    public static final Tag.Class CONTEXT_SPECIFIC

  A tag class.

### PRIVATE

    public static final Tag.Class PRIVATE

  A tag class.

### END_OF_CONTENTS

    public static final Tag 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

    public static final Tag EOC

  An alias for END_OF_CONTENTS.

### numTagInstances

    private static final int numTagInstances

See Also:
  Constant Field Values

### tagInstances

    private static Tag[] tagInstances

Constructor Detail

### Tag

    private Tag()

### Tag

    public Tag(Tag.Class clazz,
               long num)

  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 Detail

### getNum

    public long getNum()

  Returns the tag number.

### getTagClass

    public Tag.Class getTagClass()

  Returns the tag class.

### get

    public static Tag get(long num)

  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.

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Compares two tags for equality. Tags are equal if they have the same class and tag number.

  Overrides:
    `equals` in class `java.lang.Object`

### toString

    public java.lang.String 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".

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD