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 BITSTRBITSTRING type.BMPSTRBMPString type.BOOLBOOLEAN type.CHARSTRCharacterString type.EMBPDVEMBEDDED PDV type.ENUMENUMERATED type.EXTEXTERNAL type.GENSTRGeneralString type.GENTIMEGeneralizedTime type.GRAPHICSTRGraphicString type.IA5STRIA5String type.INTINTEGER type.ISO646STRISO646String type.NULLNULL type.NUMSTRNumericString type.OCTSTROCTETSTRING type.ODESCObjectDescriptor type.OIDOBJECT IDENTIFIER type.PRINTSTRPrintableString type.REALREAL type.ROIDRELATIVE-OID type.SEQSEQUENCE type.SETSET type.T61STRT61String type.UNISTRUniversalString type.UTCTIMEUTCTime type.UTF8STRUTF8String type.VTEXSTRVideotexString type.
-
Field Summary
Fields Modifier and Type Field Description private booleanconstructedFlag indicating whether value is primitive or constructed.static intTAG_CLASSUniversal tag class is 00b in first two high-order bytes.private static Map<String,UniversalDERTag>TAGNAME_MAPMaps tag names to tags.private inttagNoTag number.private static Map<Integer,UniversalDERTag>TAGNO_MAPMaps tag numbers to tags.-
Fields inherited from interface org.ldaptive.asn1.DERTag
ASN_CONSTRUCTED
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUniversalDERTag(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 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.intgetTagByte()Gets the value of this tag for encoding.intgetTagNo()Gets the decimal value of the tag.booleanisConstructed()Determines whether the tag is constructed or primitive.static UniversalDERTagvalueOf(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:
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
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.
-
-