Package org.ldaptive.asn1
Enum UniversalDERTag
- All Implemented Interfaces:
Serializable,Comparable<UniversalDERTag>,DERTag
Enumeration with common BER/DER universal tag types.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBITSTRING type.BMPString type.BOOLEAN type.CharacterString type.EMBEDDED PDV type.ENUMERATED type.EXTERNAL type.GeneralString type.GeneralizedTime type.GraphicString type.IA5String type.INTEGER type.ISO646String type.NULL type.NumericString type.OCTETSTRING type.ObjectDescriptor type.OBJECT IDENTIFIER type.PrintableString type.REAL type.RELATIVE-OID type.SEQUENCE type.SET type.T61String type.UniversalString type.UTCTime type.UTF8String type.VideotexString type. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanFlag indicating whether value is primitive or constructed.static final intUniversal tag class is 00b in first two high-order bytes.private static final Map<String,UniversalDERTag> Maps tag names to tags.private final intTag number.private static final Map<Integer,UniversalDERTag> Maps tag numbers to tags.Fields inherited from interface org.ldaptive.asn1.DERTag
ASN_CONSTRUCTED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUniversalDERTag(int number, boolean isConstructed) Creates a new universal DER tag. -
Method Summary
Modifier and TypeMethodDescriptionstatic UniversalDERTagfromTagName(String name) Looks up a universal tag from a tag name.static UniversalDERTagfromTagNo(int number) Looks up a universal tag from a tag number.intGets the value of this tag for encoding.intgetTagNo()Gets the decimal value of the tag.booleanDetermines whether the tag is constructed or primitive.static UniversalDERTagReturns 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 Details
-
BOOL
BOOLEAN type. -
INT
INTEGER type. -
BITSTR
BITSTRING type. -
OCTSTR
OCTETSTRING type. -
NULL
NULL type. -
OID
OBJECT IDENTIFIER type. -
ODESC
ObjectDescriptor type. -
EXT
EXTERNAL type. -
REAL
REAL type. -
ENUM
ENUMERATED type. -
EMBPDV
EMBEDDED PDV type. -
UTF8STR
UTF8String type. -
ROID
RELATIVE-OID type. -
SEQ
SEQUENCE type. -
SET
SET type. -
NUMSTR
NumericString type. -
PRINTSTR
PrintableString type. -
T61STR
T61String type. -
VTEXSTR
VideotexString type. -
IA5STR
IA5String type. -
UTCTIME
UTCTime type. -
GENTIME
GeneralizedTime type. -
GRAPHICSTR
GraphicString type. -
ISO646STR
ISO646String type. -
GENSTR
GeneralString type. -
UNISTR
UniversalString type. -
CHARSTR
CharacterString type. -
BMPSTR
BMPString type.
-
-
Field Details
-
TAG_CLASS
public static final int TAG_CLASSUniversal tag class is 00b in first two high-order bytes.- See Also:
-
TAGNO_MAP
Maps tag numbers to tags. -
TAGNAME_MAP
Maps tag names to tags. -
tagNo
private final int tagNoTag number. -
constructed
private final boolean constructedFlag 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 tagisConstructed- whether this tag is primitive or constructed
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
isConstructedin interfaceDERTag- Returns:
- true if constructed, false if primitive.
-
getTagByte
public int getTagByte()Description copied from interface:DERTagGets the value of this tag for encoding.- Specified by:
getTagBytein interfaceDERTag- Returns:
- byte value of this tag
-
fromTagNo
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
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.
-