Enum UniversalDERTag

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UniversalDERTag>, DERTag

    public enum UniversalDERTag
    extends java.lang.Enum<UniversalDERTag>
    implements DERTag
    Enumeration with common BER/DER universal tag types.
    Author:
    Middleware Services
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TAG_CLASS
      Universal tag class is 00b in first two high-order bytes.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UniversalDERTag fromTagName​(java.lang.String name)
      Looks up a universal tag from a tag name.
      static UniversalDERTag fromTagNo​(int number)
      Looks up a universal tag from a tag number.
      int getTagByte()
      Gets the value of this tag for encoding.
      int getTagNo()
      Gets the decimal value of the tag.
      boolean isConstructed()
      Determines whether the tag is constructed or primitive.
      static UniversalDERTag valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UniversalDERTag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.ldaptive.asn1.DERTag

        name
    • Field Detail

      • TAG_CLASS

        public static final int TAG_CLASS
        Universal tag class is 00b in first two high-order bytes.
        See Also:
        Constant Field Values
    • Method Detail

      • values

        public static UniversalDERTag[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UniversalDERTag c : UniversalDERTag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UniversalDERTag valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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:
        java.lang.IllegalArgumentException - if tag is unknown
      • fromTagName

        public static UniversalDERTag fromTagName​(java.lang.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.