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.
        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())
        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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        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
        decimal tag number.
      • isConstructed

        public boolean isConstructed()
        Determines whether the tag is constructed or primitive.
        Specified by:
        isConstructed in interface DERTag
        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
        byte value of this tag
      • fromTagNo

        public static UniversalDERTag fromTagNo​(int number)
        Looks up a universal tag from a tag number.
        number - tag number.
        tag object corresponding to given number.
        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.
        name - tag name.
        tag object corresponding to given name or null if no tag of the given name is found.