SEQUENCE and SEQUENCE OF constructs.
DER form is always definite form length fields, while BER support uses indefinite form.
X.690
8: Basic encoding rules
8.9 Encoding of a sequence value
8.9.1 The encoding of a sequence value shall be constructed.8.9.2 The contents octets shall consist of the complete encoding of one data value from each of the types listed in the ASN.1 definition of the sequence type, in the order of their appearance in the definition, unless the type was referenced with the keyword OPTIONAL or the keyword DEFAULT.
8.9.3 The encoding of a data value may, but need not, be present for a type which was referenced with the keyword OPTIONAL or the keyword DEFAULT. If present, it shall appear in the encoding at the point corresponding to the appearance of the type in the ASN.1 definition.
8.10 Encoding of a sequence-of value
8.10.1 The encoding of a sequence-of value shall be constructed.
8.10.2 The contents octets shall consist of zero, one or more complete encodings of data values from the type listed in the ASN.1 definition.
8.10.3 The order of the encodings of the data values shall be the same as the order of the data values in the sequence-of value to be encoded.
9: Canonical encoding rules
9.1 Length forms
If the encoding is constructed, it shall employ the indefinite-length form. If the encoding is primitive, it shall include the fewest length octets necessary. [Contrast with 8.1.3.2 b).]11: Restrictions on BER employed by both CER and DER
11.5 Set and sequence components with default value
The encoding of a set value or sequence value shall not include an encoding for any component value which is equal to its default value.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ASN1Encodable[] | |
| pack-priv static final ASN1UniversalType |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ASN1Sequence(ASN1Encodable
the object to be put in the SEQUENCE. element)Create a SEQUENCE containing one object. |
| protected | ASN1Sequence(ASN1Encodable
the first object to be put in the SEQUENCE. element1, ASN1Encodable the second object to be put in the SEQUENCE. element2)Create a SEQUENCE containing two objects. |
| protected | ASN1Sequence(ASN1EncodableVector
the vector of objects to be put in the SEQUENCE. elementVector)Create a SEQUENCE containing a vector of objects. |
| protected | ASN1Sequence(ASN1Encodable[]
the array of objects to be put in the SEQUENCE. elements)Create a SEQUENCE containing an array of objects. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | asn1Equals(ASN1Primitive other)
Implements abstract org. Equality (similarity) comparison for two ASN1Primitive objects. |
| pack-priv boolean | encodeConstructed()
Implements abstract org. Return true if this objected is a CONSTRUCTED one, false otherwise. |
| pack-priv ASN1BitString[] | |
| pack-priv ASN1OctetString[] | |
| public static ASN1Sequence | Returns: an ASN1Sequence instance, or null.the object we want converted. obj)Return an ASN1Sequence from the given object. |
| public static ASN1Sequence | Returns: an ASN1Sequence instance.the tagged object. taggedObject, boolean true if the object is meant to be explicitly tagged,
false otherwise. explicit)Return an ASN1 SEQUENCE from a tagged object. |
| public ASN1Encodable | Returns: the object at the sequence position indicated by index.the sequence number (starting at zero) of the object index)Return the object at the sequence position indicated by index. |
| public Enumeration | |
| public int | hashCode()
Implements abstract org. Returns a hash code value for this object. |
| public Iterator | iterator()
Implements org. Returns an iterator over a set of elements of type T. |
| public ASN1SequenceParser | |
| public int | Returns: the number of objects in this sequence.Return the number of objects in this sequence. |
| public ASN1Encodable[] | |
| pack-priv ASN1Encodable[] | |
| pack-priv abstract ASN1BitString | |
| pack-priv abstract ASN1External | |
| pack-priv abstract ASN1OctetString | |
| pack-priv abstract ASN1Set | |
| pack-priv ASN1Primitive | toDERObject()
Overrides org. Change current SEQUENCE object to be encoded as |
| pack-priv ASN1Primitive | toDLObject()
Overrides org. Change current SEQUENCE object to be encoded as |
| public String |
| elements | back to summary |
|---|---|
| pack-priv ASN1Encodable[] elements | |
| TYPE | back to summary |
|---|---|
| pack-priv static final ASN1UniversalType TYPE | |
| ASN1Sequence | back to summary |
|---|---|
| protected ASN1Sequence() Create an empty SEQUENCE | |
| ASN1Sequence | back to summary |
|---|---|
| protected ASN1Sequence(ASN1Encodable element) Create a SEQUENCE containing one object.
| |
| ASN1Sequence | back to summary |
|---|---|
| protected ASN1Sequence(ASN1Encodable element1, ASN1Encodable element2) Create a SEQUENCE containing two objects.
| |
| ASN1Sequence | back to summary |
|---|---|
| protected ASN1Sequence(ASN1EncodableVector elementVector) Create a SEQUENCE containing a vector of objects.
| |
| ASN1Sequence | back to summary |
|---|---|
| protected ASN1Sequence(ASN1Encodable[] elements) Create a SEQUENCE containing an array of objects.
| |
| ASN1Sequence | back to summary |
|---|---|
| pack-priv ASN1Sequence(ASN1Encodable[] elements, boolean clone) | |
| asn1Equals | back to summary |
|---|---|
| pack-priv boolean asn1Equals(ASN1Primitive other) Implements abstract org. Doc from org. Equality (similarity) comparison for two ASN1Primitive objects. | |
| encodeConstructed | back to summary |
|---|---|
| pack-priv boolean encodeConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| getConstructedBitStrings | back to summary |
|---|---|
| pack-priv ASN1BitString[] getConstructedBitStrings() | |
| getConstructedOctetStrings | back to summary |
|---|---|
| pack-priv ASN1OctetString[] getConstructedOctetStrings() | |
| getInstance | back to summary |
|---|---|
| public static ASN1Sequence getInstance(Object obj) Return an ASN1Sequence from the given object.
| |
| getInstance | back to summary |
|---|---|
| public static ASN1Sequence getInstance(ASN1TaggedObject taggedObject, boolean explicit) Return an ASN1 SEQUENCE from a tagged object. There is a special case here, if an object appears to have been explicitly tagged on reading but we were expecting it to be implicitly tagged in the normal course of events it indicates that we lost the surrounding sequence - so we need to add it back (this will happen if the tagged object is a sequence that contains other sequences). If you are dealing with implicitly tagged sequences you really should be using this method.
| |
| getObjectAt | back to summary |
|---|---|
| public ASN1Encodable getObjectAt(int index) Return the object at the sequence position indicated by index.
| |
| getObjects | back to summary |
|---|---|
| public Enumeration | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Returns an iterator over a set of elements of type T.
| |
| parser | back to summary |
|---|---|
| public ASN1SequenceParser parser() | |
| size | back to summary |
|---|---|
| public int size() Return the number of objects in this sequence.
| |
| toArray | back to summary |
|---|---|
| public ASN1Encodable[] toArray() | |
| toArrayInternal | back to summary |
|---|---|
| pack-priv ASN1Encodable[] toArrayInternal() | |
| toASN1BitString | back to summary |
|---|---|
| pack-priv abstract ASN1BitString toASN1BitString() | |
| toASN1External | back to summary |
|---|---|
| pack-priv abstract ASN1External toASN1External() | |
| toASN1OctetString | back to summary |
|---|---|
| pack-priv abstract ASN1OctetString toASN1OctetString() | |
| toASN1Set | back to summary |
|---|---|
| pack-priv abstract ASN1Set toASN1Set() | |
| toDERObject | back to summary |
|---|---|
| pack-priv ASN1Primitive toDERObject() Overrides org. Change current SEQUENCE object to be encoded as
| |
| toDLObject | back to summary |
|---|---|
| pack-priv ASN1Primitive toDLObject() Overrides org. Change current SEQUENCE object to be encoded as
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |