Package org.ldaptive.asn1
Enum UniversalDERTag
- java.lang.Object
-
- java.lang.Enum<UniversalDERTag>
-
- org.ldaptive.asn1.UniversalDERTag
-
- All Implemented Interfaces:
Serializable
,Comparable<UniversalDERTag>
,DERTag
public enum UniversalDERTag extends Enum<UniversalDERTag> implements DERTag
Enumeration with common BER/DER universal tag types.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BITSTR
BITSTRING type.BMPSTR
BMPString type.BOOL
BOOLEAN type.CHARSTR
CharacterString type.EMBPDV
EMBEDDED PDV type.ENUM
ENUMERATED type.EXT
EXTERNAL type.GENSTR
GeneralString type.GENTIME
GeneralizedTime type.GRAPHICSTR
GraphicString type.IA5STR
IA5String type.INT
INTEGER type.ISO646STR
ISO646String type.NULL
NULL type.NUMSTR
NumericString type.OCTSTR
OCTETSTRING type.ODESC
ObjectDescriptor type.OID
OBJECT IDENTIFIER type.PRINTSTR
PrintableString type.REAL
REAL type.ROID
RELATIVE-OID type.SEQ
SEQUENCE type.SET
SET type.T61STR
T61String type.UNISTR
UniversalString type.UTCTIME
UTCTime type.UTF8STR
UTF8String type.VTEXSTR
VideotexString type.
-
Field Summary
Fields Modifier and Type Field Description private boolean
constructed
Flag indicating whether value is primitive or constructed.static int
TAG_CLASS
Universal tag class is 00b in first two high-order bytes.private static Map<String,UniversalDERTag>
TAGNAME_MAP
Maps tag names to tags.private int
tagNo
Tag number.private static Map<Integer,UniversalDERTag>
TAGNO_MAP
Maps tag numbers to tags.-
Fields inherited from interface org.ldaptive.asn1.DERTag
ASN_CONSTRUCTED
-
-
Constructor Summary
Constructors Modifier Constructor Description private
UniversalDERTag(int number, boolean isConstructed)
Creates a new universal DER tag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UniversalDERTag
fromTagName(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(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.
-
-
-
Enum Constant Detail
-
BOOL
public static final UniversalDERTag BOOL
BOOLEAN type.
-
INT
public static final UniversalDERTag INT
INTEGER type.
-
BITSTR
public static final UniversalDERTag BITSTR
BITSTRING type.
-
OCTSTR
public static final UniversalDERTag OCTSTR
OCTETSTRING type.
-
NULL
public static final UniversalDERTag NULL
NULL type.
-
OID
public static final UniversalDERTag OID
OBJECT IDENTIFIER type.
-
ODESC
public static final UniversalDERTag ODESC
ObjectDescriptor type.
-
EXT
public static final UniversalDERTag EXT
EXTERNAL type.
-
REAL
public static final UniversalDERTag REAL
REAL type.
-
ENUM
public static final UniversalDERTag ENUM
ENUMERATED type.
-
EMBPDV
public static final UniversalDERTag EMBPDV
EMBEDDED PDV type.
-
UTF8STR
public static final UniversalDERTag UTF8STR
UTF8String type.
-
ROID
public static final UniversalDERTag ROID
RELATIVE-OID type.
-
SEQ
public static final UniversalDERTag SEQ
SEQUENCE type.
-
SET
public static final UniversalDERTag SET
SET type.
-
NUMSTR
public static final UniversalDERTag NUMSTR
NumericString type.
-
PRINTSTR
public static final UniversalDERTag PRINTSTR
PrintableString type.
-
T61STR
public static final UniversalDERTag T61STR
T61String type.
-
VTEXSTR
public static final UniversalDERTag VTEXSTR
VideotexString type.
-
IA5STR
public static final UniversalDERTag IA5STR
IA5String type.
-
UTCTIME
public static final UniversalDERTag UTCTIME
UTCTime type.
-
GENTIME
public static final UniversalDERTag GENTIME
GeneralizedTime type.
-
GRAPHICSTR
public static final UniversalDERTag GRAPHICSTR
GraphicString type.
-
ISO646STR
public static final UniversalDERTag ISO646STR
ISO646String type.
-
GENSTR
public static final UniversalDERTag GENSTR
GeneralString type.
-
UNISTR
public static final UniversalDERTag UNISTR
UniversalString type.
-
CHARSTR
public static final UniversalDERTag CHARSTR
CharacterString type.
-
BMPSTR
public static final UniversalDERTag BMPSTR
BMPString type.
-
-
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_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.
-
-
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 nameNullPointerException
- if the argument is null
-
getTagNo
public int getTagNo()
Gets the decimal value of the tag.
-
isConstructed
public boolean isConstructed()
Determines whether the tag is constructed or primitive.- Specified by:
isConstructed
in interfaceDERTag
- 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 interfaceDERTag
- 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 fromvalueOf(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.
-
-