public class ASN1Enumerated extends ASN1Primitive
| Modifier and Type | Field and Description |
|---|---|
(package private) byte[] |
bytes |
private static ASN1Enumerated[] |
cache |
| Constructor and Description |
|---|
ASN1Enumerated(BigInteger value)
Constructor from BigInteger
|
ASN1Enumerated(byte[] bytes)
Constructor from encoded BigInteger.
|
ASN1Enumerated(int value)
Constructor from int.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
asn1Equals(ASN1Primitive o) |
(package private) void |
encode(ASN1OutputStream out) |
(package private) int |
encodedLength() |
(package private) static ASN1Enumerated |
fromOctetString(byte[] enc) |
static ASN1Enumerated |
getInstance(ASN1TaggedObject obj,
boolean explicit)
return an Enumerated from a tagged object.
|
static ASN1Enumerated |
getInstance(Object obj)
return an enumerated from the passed in object
|
BigInteger |
getValue() |
int |
hashCode() |
(package private) boolean |
isConstructed() |
equals, fromByteArray, toASN1Primitive, toDERObject, toDLObjectgetEncoded, getEncoded, hasEncodedTagValue, toASN1Objectbyte[] bytes
private static ASN1Enumerated[] cache
public ASN1Enumerated(int value)
value - the value of this enumerated.public ASN1Enumerated(BigInteger value)
value - the value of this enumerated.public ASN1Enumerated(byte[] bytes)
bytes - the value of this enumerated as an encoded BigInteger (signed).public static ASN1Enumerated getInstance(Object obj)
obj - an ASN1Enumerated or an object that can be converted into one.IllegalArgumentException - if the object cannot be converted.public static ASN1Enumerated getInstance(ASN1TaggedObject obj, boolean explicit)
obj - the tagged object holding the object we wantexplicit - true if the object is meant to be explicitly
tagged false otherwise.IllegalArgumentException - if the tagged object cannot
be converted.public BigInteger getValue()
boolean isConstructed()
isConstructed in class ASN1Primitiveint encodedLength()
encodedLength in class ASN1Primitivevoid encode(ASN1OutputStream out) throws IOException
encode in class ASN1PrimitiveIOExceptionboolean asn1Equals(ASN1Primitive o)
asn1Equals in class ASN1Primitivepublic int hashCode()
hashCode in class ASN1Primitivestatic ASN1Enumerated fromOctetString(byte[] enc)