Package net.aifusion.asn
Class EnumeratedValue
java.lang.Object
net.aifusion.asn.AsnValue
net.aifusion.asn.EnumeratedValue
Class to manage an Enumerated Value
- Author:
- Sharad Singhal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EnumeratedValue
create
(byte[] buffer, int blen, int cursor) Create an enumerated value from an input bufferboolean
byte[]
Get the encoded value for this ASN.1 value.int
getValue()
Get the value associated with this integer valueint
hashCode()
toAsnString
(String prefix) Get a (semi) ASN.1 notation for this value.toString()
Methods inherited from class net.aifusion.asn.AsnValue
getLength, getTag, getTagClass, getTagEncoding, getTagNumber, toHex, toHex, toHex, toHex
-
Constructor Details
-
EnumeratedValue
public EnumeratedValue(int value) Create an enumerated value- Parameters:
value
- - integer value associated with the Enumerated Value
-
-
Method Details
-
getEncodedValue
public byte[] getEncodedValue()Description copied from class:AsnValue
Get the encoded value for this ASN.1 value. This method should be implemented by subclasses to provide the encoded ASN.1 value- Specified by:
getEncodedValue
in classAsnValue
- Returns:
- byte [] containing encoded value for this ASN.1 value (including tag, length, content)
-
create
Create an enumerated value from an input buffer- Parameters:
buffer
- - buffer containing input bytesblen
- - length of the buffercursor
- - current position in the buffer- Returns:
- - enumerated value
-
getValue
public int getValue()Get the value associated with this integer value- Returns:
- - value associated with this enumerated value
-
toAsnString
Description copied from class:AsnValue
Get a (semi) ASN.1 notation for this value.- Overrides:
toAsnString
in classAsnValue
- Parameters:
prefix
- - prefix to add to each line- Returns:
- - string containing the ASN.1 value
-
hashCode
public int hashCode() -
equals
-
toString
-