SequenceOf type¶
-
class
pyasn1.type.univ.SequenceOf(componentType=None, tagSet=TagSet(), subtypeSpec=ConstraintsIntersection(), sizeSpec=ConstraintsIntersection())¶ Create SequenceOf type.
SequenceOf objects are mutable and duck-type Python
listobjects.Parameters: - componentType (
PyAsn1Itemderivative) – A pyasn1 object representing ASN.1 type allowed within SequenceOf type - tagSet (
TagSet) – Object representing non-default ASN.1 tag(s) - subtypeSpec (
ConstraintsIntersection) – Object representing non-default ASN.1 subtype constraint(s) - sizeSpec (
ConstraintsIntersection) – Object representing collection size constraint
Note
The SequenceOf type models a collection of elements of a single ASN.1 type. Ordering of the components is preserved upon de/serialization.
-
clone(componentType=None, tagSet=TagSet(), subtypeSpec=ConstraintsIntersection())¶ Create a copy of a SequenceOf type or object.
Any parameters to the clone() method will replace corresponding properties of the SequenceOf object.
Parameters: - tagSet (
TagSet) – Object representing non-default ASN.1 tag(s) - subtypeSpec (
ConstraintsIntersection) – Object representing non-default ASN.1 subtype constraint(s) - sizeSpec (
ConstraintsIntersection) – Object representing non-default ASN.1 size constraint(s)
Returns: new instance of SequenceOf type/value
- tagSet (
-
subtype(componentType=None, implicitTag=Tag(), explicitTag=Tag(), subtypeSpec=ConstraintsIntersection())¶ Create a copy of a SequenceOf type or object.
Any parameters to the subtype() method will be added to the corresponding properties of the SequenceOf object.
Parameters: - tagSet (
TagSet) – Object representing non-default ASN.1 tag(s) - subtypeSpec (
ConstraintsIntersection) – Object representing non-default ASN.1 subtype constraint(s) - sizeSpec (
ConstraintsIntersection) – Object representing non-default ASN.1 size constraint(s)
Returns: new instance of SequenceOf type/value
- tagSet (
-
tagSet= TagSet((), Tag(tagClass=0, tagFormat=32, tagId=16))¶ Default
TagSetobject for SequenceOf objects
-
componentType= None¶ Default
PyAsn1Itemderivative object representing ASN.1 type allowed within SequenceOf type
-
subtypeSpec= ConstraintsIntersection()¶ Default
ConstraintsIntersectionobject imposing constraints on SequenceOf objects
-
sizeSpec= ConstraintsIntersection()¶ Default
ConstraintsIntersectionobject imposing size constraint on SequenceOf objects
-
getComponentByPosition(idx)¶ Return SequenceOf type component value by position.
Equivalent to Python sequence subscription operation (e.g. []).
Parameters: idx ( int) – component index (zero-based)Returns: PyAsn1Item– a pyasn1 object
-
isSameTypeWith(other, matchTags=True, matchConstraints=True)¶ Examine SequenceOf type for equality with other ASN.1 type.
ASN.1 tags (
tag) and constraints (constraint) are examined when carrying out ASN.1 types comparison.No Python inheritance relationship between PyASN1 objects is considered.
Parameters: other (a pyasn1 type object) – Class instance representing ASN.1 type. Returns: bool–Trueif other is SequenceOf type,Falseotherwise.
-
isSuperTypeOf(other, matchTags=True, matchConstraints=True)¶ Examine SequenceOf type for subtype relationship with other ASN.1 type.
ASN.1 tags (
tag) and constraints (constraint) are examined when carrying out ASN.1 types comparison.No Python inheritance relationship between PyASN1 objects is considered.
Parameters: other (a pyasn1 type object) – Class instance representing ASN.1 type. Returns: bool–Trueif other is a subtype of SequenceOf type,Falseotherwise.
-
setComponentByPosition(idx, value=NoValue(), verifyConstraints=True, matchTags=True, matchConstraints=True)¶ Assign SequenceOf type component by position.
Equivalent to Python sequence item assignment operation (e.g. []).
Parameters: - idx (
int) – component index (zero-based) - value (
objectorPyAsn1Itemderivative) – A Python or pyasn1 object to assign ornoValueobject to instantiate component type. - verifyConstraints (
bool) – If False, skip constraints validation - matchTags (
bool) – If False, skip component tags matching - matchConstraints (
bool) – If False, skip component constraints matching
Returns: self
- idx (
- componentType (