1AddlZddlmZddlmZddlmZddlmZgdZGddeZ Gd d e Z e Z Gd d eZ e Z Gd de ZeZGdde ZeZdS)N)error) constraint)tag)tagmap)Asn1ItemAsn1TypeSimpleAsn1TypeConstructedAsn1Typec&eZdZeddZdS)rc txj|z c_n#t$r|t_YnwxYwtjSN)r _typeCounterAttributeError)cls increments p/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/pyasn1/type/base.py getTypeIdzAsn1Item.getTypeIdsP .  ! !Y . ! ! ! . . .$-H ! ! ! .$$s 11N)r )__name__ __module__ __qualname__ classmethodrrrrs2%%%[%%%rrceZdZdZejZejZ dZ dZ dZ dZ edZedZedZdd Zdd Zed ZddZdZdZdZdZdZdS)ra>Base class for all classes representing ASN.1 types. In the user code, |ASN.1| class is normally used only for telling ASN.1 objects from others. Note ---- For as long as ASN.1 is concerned, a way to compare ASN.1 types is to use :meth:`isSameTypeWith` and :meth:`isSuperTypeOf` methods. Nc |j|jd}|||j|||_dS)NtagSet subtypeSpec)rrupdate__dict__ _readOnlyselfkwargsreadOnlys r__init__zAsn1Type.__init__2sNk+    X&&&!rcr|ddkr ||jvrtjd|z||j|<dS)Nr_z!read-only instance attribute "%s")r"r PyAsn1Errorr!)r$namevalues r __setattr__zAsn1Type.__setattr__>sD 7c>>ddn44#$G$$NOO O# drc*|Sr) prettyPrintr$s r__str__zAsn1Type.__str__Ds!!!rc|jSr)r"r0s rr&zAsn1Type.readOnlyGs ~rc|jS)z3For |ASN.1| type is equivalent to *tagSet* rr0s reffectiveTagSetzAsn1Type.effectiveTagSetKs {rc8tj|j|iS)zvReturn a :class:`~pyasn1.type.tagmap.TagMap` object mapping ASN.1 tags to ASN.1 objects within callee object. )rTagMaprr0s rtagMapzAsn1Type.tagMapQs}dk40111rTcV||up%| s|j|jko| p|j|jkS)a?Examine |ASN.1| type for equality with other ASN.1 type. ASN.1 tags (:py:mod:`~pyasn1.type.tag`) and constraints (:py:mod:`~pyasn1.type.constraint`) are examined when carrying out ASN.1 types comparison. Python class inheritance relationship is NOT considered. Parameters ---------- other: a pyasn1 type object Class instance representing ASN.1 type. Returns ------- : :class:`bool` :obj:`True` if *other* is |ASN.1| type, :obj:`False` otherwise. rr$other matchTagsmatchConstraintss risSameTypeWithzAsn1Type.isSameTypeWithWsF( P=$+"=P%%N)9U=N)N Qrc| p@|j|jo!| p|j|jS)alExamine |ASN.1| type for subtype relationship with other ASN.1 type. ASN.1 tags (:py:mod:`~pyasn1.type.tag`) and constraints (:py:mod:`~pyasn1.type.constraint`) are examined when carrying out ASN.1 types comparison. Python class inheritance relationship is NOT considered. Parameters ---------- other: a pyasn1 type object Class instance representing ASN.1 type. Returns ------- : :class:`bool` :obj:`True` if *other* is a subtype of |ASN.1| type, :obj:`False` otherwise. )risSuperTagSetOfr isSuperTypeOfr:s rrAzAsn1Type.isSuperTypeOfosO( ],,U\::]&&[$*:*H*HIZ*[*[ ^rc(|D]}|turdSdS)NFT)noValue)valuesr,s r isNoValuezAsn1Type.isNoValues-  EG##uu$trrctr)NotImplementedErrorr$scopes rr/zAsn1Type.prettyPrints!!rc|jSrr4r0s r getTagSetzAsn1Type.getTagSet {rc|jSr)r5r0s rgetEffectiveTagSetzAsn1Type.getEffectiveTagSets ##rc|jSr)r8r0s r getTagMapzAsn1Type.getTagMaprLrc|jSrrr0s rgetSubtypeSpeczAsn1Type.getSubtypeSpecs rc|jSr)isValuer0s rhasValuezAsn1Type.hasValues |r)TTr)rrr__doc__rTagSetrrConstraintsIntersectionrtypeIdr'r-r1propertyr&r5r8r>rA staticmethodrEr/rKrNrPrSrVrrrrrsn  SZ\\F5*466KF " " "$$$ """XX 22X2 QQQQ0^^^^0\ """" $$$   rrc0eZdZdZhdZdZdZdZdZdS)NoValueazCreate a singleton instance of NoValue class. The *NoValue* sentinel object represents an instance of ASN.1 schema object as opposed to ASN.1 value object. Only ASN.1 schema-related operations can be performed on ASN.1 schema objects. Warning ------- Any operation attempted on the *noValue* object will raise the *PyAsn1Error* exception. >__del____new__r'__repr__im_class __class__ __slots__ __reduce__ __sizeof__ __delattr__ __getattr__r- __getstate__ __objclass__r __setstate__ __reduce_ex____getnewargs____getinitargs____getattribute__Ncjtd}fdttttfD}t |D]}t |||t_jS)Ncfd}|S)Nc2tjdz)N/Attempted "%s" operation on ASN.1 schema objectrr*)r$argskwr+s rplugz.NoValue.__new__..getPlug..plugs+,]`d,deeerr)r+rxs` rgetPlugz NoValue.__new__..getPlugs&fffff rc g|]f}t|D]T}|jv |d |d5t t ||R|UgS)__)dir skipMethods startswithendswithcallablegetattr).0typr+rs r z#NoValue.__new__..s;;;$'HH;;  77 OOD118 MM$//8%WS$%7%78888777r) _instancestrintlistdictsetsetattrobjectra)rryop_namesr+s` rrazNoValue.__new__s =     ;;;;$'dD#9;;;HH  2 2T774==1111"NN3//CM}rcf||jvrtd|ztjd|z)NzAttribute %s not presentrt)r}rrr*)r$attrs rrizNoValue.__getattr__s< 4# # # !;d!BCC C QTX XYYYrc d|jjzS)Nz <%s object>)rdrr0s rrbzNoValue.__repr__st~666r) rrrrXr}rrarirbrrrr_r_sf  K4I,ZZZ 77777rr_ceZdZdZeZefdZdZdZdZ dZ dZ dZ d Z d Zd Zed Zefd ZefdZdZdZddZddZdS)r aBase class for all simple classes representing ASN.1 types. ASN.1 distinguishes types by their ability to hold other objects. Scalar types are known as *simple* in ASN.1. In the user code, |ASN.1| class is normally used only for telling ASN.1 objects from others. Note ---- For as long as ASN.1 is concerned, a way to compare ASN.1 types is to use :meth:`isSameTypeWith` and :meth:`isSuperTypeOf` methods. c .tj|fi||tur|j}nj||} ||n>#t j$r,}t||d|j j d}~wwxYw||_ dS)Nz at ) rr'rC defaultValueprettyInrrr*typerdr_value)r$r,r%exValues rr'zSimpleAsn1Type.__init__s$))&))) G  %EEMM%((E U  ''''$ U U U#d7mm'''4>;R;R$STTT U sAB 'BB c6|jjd|jrdpdd}|jD]\}}|r |d|d|z }|jrG|}t |dkr|dddz|d dz}|d |zz }d |zS) N r,schema object, z...i, payload [%s]<%s>)rdrrUr&itemsr/lenr$representationrr,s rrbzSimpleAsn1Type.__repr__s N # # #T\%=g%I%I%IK =..00 < %>{%K%KL "jj55  "%)[%>%>{%K%KL "!<<>> ( (KC     '    t~e44|444rc|Srrr$r,s rrzSimpleAsn1Type.prettyIns rc t|Sr)rrs r prettyOutzSimpleAsn1Type.prettyOuts5zzrrc6||jSr)rrrHs rr/zSimpleAsn1Type.prettyPrints~~dk***rc.|jd|jjS)Nz -> )rrdrrHs rprettyPrintTypezSimpleAsn1Type.prettyPrintTypes![[[$.*A*ABBrNrW)rrrrXrCrr'rbrrrrrrrrr\rUrrrrr/rrrrr r sa  L$    ''' $$$ $$$###$$$###$$$!!!!!!**X*:"55556$B5B5B5B5H++++CCCCCCrr ceZdZdZdZdZejZdZ dZ dZ dZ dZ d Zd Zd Zd Zd ZedZdZdZdZdZddZdZdZdZdZdS)r aBase class for all constructed classes representing ASN.1 types. ASN.1 distinguishes types by their ability to hold other objects. Those "nesting" types are known as *constructed* in ASN.1. In the user code, |ASN.1| class is normally used only for telling ASN.1 objects from others. Note ---- For as long as ASN.1 is concerned, a way to compare ASN.1 types is to use :meth:`isSameTypeWith` and :meth:`isSuperTypeOf` methods. FNc |j|jd}|jdi|}||t j|fi|dS)N) componentTypesizeSpecr)rr _moveSizeSpecr rr'r#s rr'zConstructedAsn1Type.__init__sd!/   $#--f--$++(+++++rc |d|j}|r*|d|j}|r|}n||z }||d<|S)Nrr)rrr)r$r%rrs rrz!ConstructedAsn1Type._moveSizeSpecs_::j$-88  0 **]D4DEEK (& x' $/F= ! rc|jjd|jrdpdd}|jD]\}}|t ur |d|d|z }|jr1|jr*|ddd|jDzz }d |zS) Nrr,rrr=rc,g|]}t|Sr)repr)rxs rrz0ConstructedAsn1Type.__repr__..s222Qa222rr)rdrrUr&rrC componentsjoinrs rrbzConstructedAsn1Type.__repr__s N # # #T\%=g%I%I%I  =..00 <  & &un = = = rc |j}|dd}|dd}||j||d<|dd}||j||d<|D]\}}||xx|z cc<|jdi|}|r||||S)a Create a specialization of |ASN.1| schema object. The `subtype()` method accepts the same set arguments as |ASN.1| class takes on instantiation except that all parameters of the `subtype()` method are optional. With the exception of the arguments described below, the rest of supplied arguments they are used to create a copy of `self` taking precedence over the ones used to instantiate `self`. The following arguments to `subtype()` create a ASN.1 subtype out of |ASN.1| type. Other Parameters ---------------- implicitTag: :py:class:`~pyasn1.type.tag.Tag` Implicitly apply given ASN.1 tag object to `self`'s :py:class:`~pyasn1.type.tag.TagSet`, then use the result as new object's ASN.1 tag(s). explicitTag: :py:class:`~pyasn1.type.tag.Tag` Explicitly apply given ASN.1 tag object to `self`'s :py:class:`~pyasn1.type.tag.TagSet`, then use the result as new object's ASN.1 tag(s). subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Add ASN.1 constraints object to one of the `self`'s, then use the result as new object's ASN.1 constraints. Returns ------- : new instance of |ASN.1| type/value Note ---- Due to the mutable nature of the |ASN.1| object, even if no arguments are supplied, a new |ASN.1| object will be created and returned. rFrNrrr) r&rrrrrrrdr) r$r%rrrrrrrs rrzConstructedAsn1Type.subtype`sT}))++ $4e<<jj55  "%)[%>%>{%K%KL "jj55  "%)[%>%>{%K%KL "!<<>> ( (KC     '    ....  >  & &un = = = rc*tjdrru)r$idxs rgetComponentByPositionz*ConstructedAsn1Type.getComponentByPosition 8999rTc*tjdrru)r$rr,verifyConstraintss rsetComponentByPositionz*ConstructedAsn1Type.setComponentByPositionrrcZt|D] \}}|||< |D] }||||<|Sr) enumerate)r$rvr%rr,ks r setComponentsz!ConstructedAsn1Type.setComponentssI#D//  JCDII  AQiDGG rcdSrrr0s rsetDefaultComponentsz(ConstructedAsn1Type.setDefaultComponentsrrc|jSr)rr0s rgetComponentTypez$ConstructedAsn1Type.getComponentTypes !!rc0||dSrrRr0s rverifySizeSpecz"ConstructedAsn1Type.verifySizeSpecs r)T)rrrrXstrictConstraintsrrrZrr'rrbrrrrrrrr\rrrrrrrrrrrrrr r s|   M2z133H , , ,    ' ' '999((('''((('''(((%%%::X:   !!!F>>>@:::::::   """rr )syspyasn1r pyasn1.typerrr__all__rrr Asn1ItemBaser_rCr AbstractSimpleAsn1Itemr AbstractConstructedAsn1Itemrrrr s """""" " " "%%%%%v%%%EEEEExEEEP G7G7G7G7G7fG7G7G7T '))PCPCPCPCPCXPCPCPCf(,ZZZZZ(ZZZ|2r