Package org.apache.harmony.security.asn1
Class ASN1TypeCollection
java.lang.Object
org.apache.harmony.security.asn1.ASN1Type
org.apache.harmony.security.asn1.ASN1Constructed
org.apache.harmony.security.asn1.ASN1TypeCollection
- All Implemented Interfaces:
ASN1Constants
- Direct Known Subclasses:
ASN1Sequence,ASN1Set
public abstract class ASN1TypeCollection extends ASN1Constructed
This abstract class represents ASN.1 type that is a collection of ASN.1 types.
- See Also:
- ASN.1
-
Field Summary
Fields inherited from interface org.apache.harmony.security.asn1.ASN1Constants
CLASS_APPLICATION, CLASS_CONTEXTSPECIFIC, CLASS_PRIVATE, CLASS_UNIVERSAL, PC_CONSTRUCTED, PC_PRIMITIVE, TAG_ANY, TAG_BITSTRING, TAG_BMPSTRING, TAG_BOOLEAN, TAG_C_BITSTRING, TAG_C_GENERALIZEDTIME, TAG_C_OCTETSTRING, TAG_C_SEQUENCE, TAG_C_SEQUENCEOF, TAG_C_SET, TAG_C_SETOF, TAG_C_UTCTIME, TAG_C_UTF8STRING, TAG_CHOICE, TAG_EMBEDDEDPDV, TAG_ENUM, TAG_EXTERNAL, TAG_GENERALIZEDTIME, TAG_GENERALSTRING, TAG_GRAPHICSTRING, TAG_IA5STRING, TAG_INSTANCEOF, TAG_INTEGER, TAG_ISO646STRING, TAG_NULL, TAG_NUMERICSTRING, TAG_OBJDESCRIPTOR, TAG_OCTETSTRING, TAG_OID, TAG_PRINTABLESTRING, TAG_REAL, TAG_RELATIVEOID, TAG_SEQUENCE, TAG_SEQUENCEOF, TAG_SET, TAG_SETOF, TAG_T61STRING, TAG_TELETEXSTRING, TAG_UNIVERSALSTRING, TAG_UTCTIME, TAG_UTF8STRING, TAG_VIDEOTEXSTRING, TAG_VISIBLESTRING -
Constructor Summary
Constructors Modifier Constructor Description protectedASN1TypeCollection(int tagNumber, ASN1Type[] type)Constructs ASN.1 collection type. -
Method Summary
Modifier and Type Method Description protected voidgetValues(Object object, Object[] values)Provides an object's values to be encoded Derived classes should override this method to provide encoding for a selected class of objects.protected voidsetDefault(Object object, int index)Sets a default value for a collection component.protected voidsetOptional(int index)Sets a collection component as optionalMethods inherited from class org.apache.harmony.security.asn1.ASN1Constructed
checkTag, encodeASNMethods inherited from class org.apache.harmony.security.asn1.ASN1Type
decode, decode, decode, decode, encode, encodeContent, getDecodedObject, getEncodedLength, setEncodingContent, toString, verify, verify
-
Field Details
-
type
-
OPTIONAL
public final boolean[] OPTIONAL -
DEFAULT
-
-
Constructor Details
-
ASN1TypeCollection
Constructs ASN.1 collection type.- Parameters:
tagNumber- ASN.1 tag numbertype- a collection of one or more ASN.1 types.- Throws:
IllegalArgumentException- if tagNumber is invalid
-
-
Method Details
-
setOptional
protected final void setOptional(int index)Sets a collection component as optional- Parameters:
index- an index of a component
-
setDefault
Sets a default value for a collection component. The component also became an optional component.- Parameters:
object- a component's default valueindex- an index of a component
-
getValues
Provides an object's values to be encoded Derived classes should override this method to provide encoding for a selected class of objects. The default implementation throws RuntimeException.- Parameters:
object- an object to be encodedvalues- an array to store an object's values to be encoded
-