Enum UniversalDERTag

    • 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
      • tagNo

        private final int tagNo
        Tag number.
      • constructed

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

      • 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 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​(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:
        IllegalArgumentException - if this enum type 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.