Enum Class UniversalDERTag

java.lang.Object
java.lang.Enum<UniversalDERTag>
org.ldaptive.asn1.UniversalDERTag
All Implemented Interfaces:
Serializable, Comparable<UniversalDERTag>, Constable, DERTag

public enum UniversalDERTag extends Enum<UniversalDERTag> implements DERTag
Enumeration with common BER/DER universal tag types.
  • Enum Constant Details

  • Field Details

    • TAG_CLASS

      public static final int TAG_CLASS
      Universal tag class is 00b in first two high-order bytes.
      See Also:
    • TAGNO_MAP

      private static final Map<Integer,UniversalDERTag> TAGNO_MAP
      Maps tag numbers to tags.
    • TAGNAME_MAP

      private static final Map<String,UniversalDERTag> TAGNAME_MAP
      Maps tag names to tags.
    • tagNo

      private final int tagNo
      Tag number.
    • constructed

      private final boolean constructed
      Flag indicating whether value is primitive or constructed.
  • Constructor Details

    • UniversalDERTag

      private UniversalDERTag(int number, boolean isConstructed)
      Creates a new universal DER tag.
      Parameters:
      number - of the tag
      isConstructed - whether this tag is primitive or constructed
  • Method Details

    • values

      public static UniversalDERTag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UniversalDERTag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getTagNo

      public int getTagNo()
      Gets the decimal value of the tag.
      Specified by:
      getTagNo in interface DERTag
      Returns:
      decimal tag number.
    • isConstructed

      public boolean isConstructed()
      Determines whether the tag is constructed or primitive.
      Specified by:
      isConstructed in interface DERTag
      Returns:
      true if constructed, false if primitive.
    • getTagByte

      public int getTagByte()
      Description copied from interface: DERTag
      Gets the value of this tag for encoding.
      Specified by:
      getTagByte in interface DERTag
      Returns:
      byte value of this tag
    • fromTagNo

      public static UniversalDERTag fromTagNo(int number)
      Looks up a universal tag from a tag number.
      Parameters:
      number - tag number.
      Returns:
      tag object corresponding to given number.
      Throws:
      IllegalArgumentException - if tag is unknown
    • fromTagName

      public static UniversalDERTag fromTagName(String name)
      Looks up a universal tag from a tag name. This method differs from valueOf(String) in that it does not throw for unknown names.
      Parameters:
      name - tag name.
      Returns:
      tag object corresponding to given name or null if no tag of the given name is found.