Lע2ddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddlm Z ddlm Z dd lm Z dd lmZe jZeZgd ZGd d e jZGddeZGddeZGdde jZGdde jZGddeZGdde jZGdde jZGdde jZGddeZGd d!e jZGd"d#eZ Gd$d%eZ!Gd&d'e jZ"Gd(d)e"Z#Gd*d+e"Z$Gd,d-e$Z%Gd.d/eZ&dS)0N)error)eoo)integer)base) constraint) namedtype)namedval)tag)tagmap)IntegerBoolean BitString OctetStringNullObjectIdentifierReal EnumeratedSequenceOfAndSetOfBase SequenceOfSetOfSequenceAndSetBaseSequenceSetChoiceAnyNoValuenoValueceZdZdZejejejejdZ e j Z e jZejZefdZdZdZdZdZdZd Zd Zd Zd Zd ZdZ dZ!dZ"dZ#dZ$dZ%d2dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-ejj.Z.dZ/dZ0dZ1d Z2d!Z3d"Z4d#Z5d3d%Z6d&Z7d'Z8d(Z9d)Z:d*Z;d+Zd.Z?d/Z@d0ZAd1ZBdS)4r aCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python :class:`int` or :class:`str` literal or |ASN.1| class instance. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class ErrorCode(Integer): ''' ASN.1 specification: ErrorCode ::= INTEGER { disk-full(1), no-disk(-1), disk-not-formatted(2) } error ErrorCode ::= disk-full ''' namedValues = NamedValues( ('disk-full', 1), ('no-disk', -1), ('disk-not-formatted', 2) ) error = ErrorCode('disk-full') c Rd|vr |j|d<tjj||fi|dS)N namedValues)r!rSimpleAsn1Type__init__selfvaluekwargss p/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/pyasn1/type/univ.pyr#zInteger.__init__es>  & &$($4F= ! $T5;;F;;;;;c<||j|zSNclone_valuer%r&s r(__and__zInteger.__and__kzz$+-...r)c<|||jzSr+r,r/s r(__rand__zInteger.__rand__nzz%$+-...r)c<||j|zSr+r,r/s r(__or__zInteger.__or__qr1r)c<|||jzSr+r,r/s r(__ror__zInteger.__ror__tr4r)c<||j|z Sr+r,r/s r(__xor__zInteger.__xor__wr1r)c<|||jz Sr+r,r/s r(__rxor__zInteger.__rxor__zr4r)c<||j|zSr+r,r/s r( __lshift__zInteger.__lshift__}zz$+.///r)c<||j|z Sr+r,r/s r( __rshift__zInteger.__rshift__r?r)c<||j|zSr+r,r/s r(__add__zInteger.__add__r1r)c<|||jzSr+r,r/s r(__radd__zInteger.__radd__r4r)c<||j|z Sr+r,r/s r(__sub__zInteger.__sub__r1r)c<|||jz Sr+r,r/s r(__rsub__zInteger.__rsub__r4r)c<||j|zSr+r,r/s r(__mul__zInteger.__mul__r1r)c<|||jzSr+r,r/s r(__rmul__zInteger.__rmul__r4r)c<||j|zSr+r,r/s r(__mod__zInteger.__mod__r1r)c<|||jzSr+r,r/s r(__rmod__zInteger.__rmod__r4r)NcT|t|j||Sr+r-powr.r%r&modulos r(__pow__zInteger.__pow__s"zz#dk5&99:::r)cR|t||jSr+rSr/s r(__rpow__zInteger.__rpow__s zz#eT[11222r)c<||j|zSr+r,r/s r( __floordiv__zInteger.__floordiv__r?r)c<|||jzSr+r,r/s r( __rfloordiv__zInteger.__rfloordiv__szz%4;.///r)c0t|j|z Sr+rr.r/s r( __truediv__zInteger.__truediv__sDK%'(((r)c0t||jz Sr+r_r/s r( __rtruediv__zInteger.__rtruediv__sEDK'(((r)cR|t|j|Sr+r-divmodr.r/s r( __divmod__zInteger.__divmod__s zz&e44555r)cR|t||jSr+rdr/s r( __rdivmod__zInteger.__rdivmod__s zz& 44555r)c*t|jSr+intr.r%s r(__int__zInteger.__int__4;r)c*t|jSr+floatr.rls r( __float__zInteger.__float__T[!!!r)cP|t|jSr+)r-absr.rls r(__abs__zInteger.__abs__szz#dk**+++r)c*t|jSr+rjrls r( __index__zInteger.__index__rnr)c8||j Sr+r,rls r(__pos__zInteger.__pos__zz4;,'''r)c8||j Sr+r,rls r(__neg__zInteger.__neg__r{r)c8||jSr+r,rls r( __invert__zInteger.__invert__r{r)rc^t|j|}|r||S|Sr+)roundr.r-r%nrs r( __round__zInteger.__round__s0 $+q ! !  ::a== Hr)c4tj|jSr+)mathfloorr.rls r( __floor__zInteger.__floor__sz$+&&&r)c4tj|jSr+)rceilr.rls r(__ceil__zInteger.__ceil__sy%%%r)cZ|tj|jSr+)r-rtruncr.rls r( __trunc__zInteger.__trunc__s zz$*T[11222r)c|j|kSr+r.r/s r(__lt__zInteger.__lt__{U""r)c|j|kSr+rr/s r(__le__zInteger.__le__{e##r)c|j|kSr+rr/s r(__eq__zInteger.__eq__rr)c|j|kSr+rr/s r(__ne__zInteger.__ne__rr)c|j|kSr+rr/s r(__gt__zInteger.__gt__rr)c|j|kSr+rr/s r(__ge__zInteger.__ge__rr)c t|S#t$r= |j|cYS#t$r}t jd|d|d}~wwxYwwxYw)Nz Can't coerce z into integer: )rk ValueErrorr!KeyErrorr PyAsn1Errorr%r&excs r(prettyInzInteger.prettyIns u::     '....   '';@55##F   s( A +A AAAAcv t|j|S#t$rt|cYSwxYwr+)strr!rr/s r( prettyOutzInteger.prettyOutsJ t'.// /   u::    s 88c|jSr+r!rls r(getNamedValueszInteger.getNamedValuess r)r+r)C__name__ __module__ __qualname____doc__r initTagSetTagtagClassUniversaltagFormatSimpletagSetrConstraintsIntersection subtypeSpecr NamedValuesr!rr" getTypeIdtypeIdrr#r0r3r6r8r:r<r>rArCrErGrIrKrMrOrQrWrYr[r]r`rbrfrh__hash__rmrrrvrxrzr}rrrrrrrrrrrrrrr)r(r r sI00hS^%s':DAAF5*466K'(&((K * * , ,F$<<<< //////////////////000000////////////////////////;;;;333000000))))))666666"+H   """,,,   ((((((((('''&&&333###$$$$$$$$$###$$$        r)r ceZdZdZejejejejdZ e j e j ddzZ ejddZe ZdS)r adCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python :class:`int` or :class:`str` literal or |ASN.1| class instance. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s).Constraints verification for |ASN.1| type occurs automatically on object instantiation. namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class RoundResult(Boolean): ''' ASN.1 specification: RoundResult ::= BOOLEAN ok RoundResult ::= TRUE ko RoundResult ::= FALSE ''' ok = RoundResult(True) ko = RoundResult(False) r)Falser)TruerN)rrrrr rrrrrr rrSingleValueConstraintr rr!rrrr)r(r r s**\S^%s':DAAF%(H (HA(N(NNK'(&|[AAK   FFFr)r c"eZdZdxZZdZdZdS) SizedIntegerNch||_t||z d|_|SNr) bitLengthmax bit_lengthleadingZeroBits)r%rs r( setBitLengthzSizedInteger.setBitLengthIs/""9t/@/@#@!DD r)cl|j'|||jSr+)rrrrls r(__len__zSizedInteger.__len__Ns0 > !   doo// 0 0 0~r))rrrrrrrrr)r(rrFs<"&&I r)rceZdZdZejejejejdZ e j Z e jZejZexZZefdZdZdZdZdZdZd Zd Zd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.e/d"dZ0e/d"dZ1e/d#d Z2d!Z3dS)$raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type both Python :class:`tuple` (as a tuple of bits) and :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python :class:`int` or :class:`str` literal representing binary or hexadecimal number or sequence of integer bits or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers binValue: :py:class:`str` Binary string initializer to use instead of the *value*. Example: '10110011'. hexValue: :py:class:`str` Hexadecimal string initializer to use instead of the *value*. Example: 'DEADBEEF'. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class Rights(BitString): ''' ASN.1 specification: Rights ::= BIT STRING { user-read(0), user-write(1), group-read(2), group-write(3), other-read(4), other-write(5) } group1 Rights ::= { group-read, group-write } group2 Rights ::= '0011'B group3 Rights ::= '3'H ''' namedValues = NamedValues( ('user-read', 0), ('user-write', 1), ('group-read', 2), ('group-write', 3), ('other-read', 4), ('other-write', 5) ) group1 = Rights(('group-read', 'group-write')) group2 = Rights('0011') group3 = Rights(0x3) c |turz|rx ||dd}n#t$rYnwxYw ||dd}n#t$rYnwxYw|turU|jtur||jd}n*|jtur||jd}d|vr |j|d<tj j ||fi|dS)NbinValueTinternalFormathexValuer!) rfromBinaryStringpopr fromHexStringdefaultBinValuedefaultHexValuer!rr"r#r$s r(r#zBitString.__init__sL G    11&**Z2H2HY]1^^EED ..vzz*/E/EVZ.[[EED G  #722--d.BSW-XX%W44**4+?PT*UU  & &$($4F= ! $T5;;F;;;;;s!*8 AA *A44 BBc*|Sr+)asBinaryrls r(__str__zBitString.__str__s}}r)c||}||up/|j|ko$t|jt|kSr+rr.lenr%others r(rzBitString.__eq__sD e$$u}W u 4 WT[9I9ISQVZZ9WWr)c||}|j|kp$t|jt|kSr+rrs r(rzBitString.__ne__s: e$${e#Es4;'7'73u::'EEr)c||}t|jt|kp/t|jt|ko |j|kSr+rrr.rs r(rzBitString.__lt__W e$$4;#e**,fDK0@0@CJJ0N0fSWS^afSffr)c||}t|jt|kp/t|jt|ko |j|kSr+rrs r(rzBitString.__le__W e$$4;3u::-hT[1A1ASZZ1O1hTXT_chThhr)c||}t|jt|kp/t|jt|ko |j|kSr+rrs r(rzBitString.__gt__rr)c||}t|jt|kp/t|jt|ko |j|kSr+rrs r(rzBitString.__ge__rr)c*t|jSr+rr.rls r(rzBitString.__len__rnr)c 4|jturHfdt|t DSt jdz }||ks|dkrtdj||z z dzS)Nc g|] }| Srr).0xr%s r( z)BitString.__getitem__..sMMM1tAwMMMr)rrzbit index out of range) __class__slicer-rangeindicesrr. IndexError)r%ilengths` r( __getitem__zBitString.__getitem__s ;%  ::MMMMqyyT7K7K0LMMMNN N%%)F6zzQUU !9:::KFQJ/14 4r)c#fKt|j}|r|dz}|j|z dzV|dSdSNrr)r%rs r(__iter__zBitString.__iter__s\T[!! . aKF;&(A- - - - . . . . .r)c:tt|Sr+)reversedtuplerls r( __reversed__zBitString.__reversed__sd $$$r)c ||}|t|jt |z|zt |jt |zSr+)rr-rr.rrr/s r(rCzBitString.__add__si e$$zz,t{c%jj'@5'HIIVVWZ[_[fWgWgjmnsjtjtWtuuvvvr)c||}|t|t|jz|jzt|jt|zSr+)rr-rrr.rr/s r(rEzBitString.__radd__sm e$$zz,uDK0@0@'@4;'NOO\\]`aeal]m]mpstypzpz]z{{|||r)c|j}|dkr,|t|jz}||jz}|dz}|dk,||Sr)r.rr-)r%r& bitStrings r(rKzBitString.__mul__sZK aii #dk** *I  $I QJEaiizz)$$$r)c ||zSr+rr/s r(rMzBitString.__rmul__  e|r)c|t|j|zt |j|zSr+)r-rr.rrr%counts r(r>zBitString.__lshift__ sAzz,t{e';<<II#dkJZJZ]bJbccdddr)c |t|j|z t dt |j|z Sr)r-rr.rrrrs r(rAzBitString.__rshift__sNzz,t{e';<<II#aQTUYU`QaQadiQiJjJjkklllr)c*t|jSr+rjrls r(rmzBitString.__int__rnr)c*t|jSr+rprls r(rrzBitString.__float__rsr)cDt|S)zGet |ASN.1| value as a sequence of 8-bit integers. If |ASN.1| object length is not a multiple of 8, result will be left-padded with zeros. )rasOctetsrls r( asNumberszBitString.asNumberss T]]__%%%r)cRtj|jt|S)zGet |ASN.1| value as a sequence of octets. If |ASN.1| object length is not a multiple of 8, result will be left-padded with zeros. )r)rto_bytesr.rrls r(r zBitString.asOctets s"  CII>>>>r)c|jS)z5Get |ASN.1| value as a single integer value. rrls r( asIntegerzBitString.asInteger(s {r)ct|jdd}dt|jt|z z|zS)z4Get |ASN.1| value as a text string of bits. rN0)binr.r)r% binStrings r(rzBitString.asBinary-sA $$QRR( c$+&&Y789DDr)FNc t|dt|dz}n0#t$r#}t j|jd|d}~wwxYw|_tt|t|z|zt|t|z}|s ||}|S)Create a |ASN.1| object initialized from the hex string. Parameters ---------- value: :class:`str` Text string like 'DEADBEEF' z.fromHexString() error: Nrrrrrrrclsr&rprependrs r(rzBitString.fromHexString3s Z ++88UaHHEE Z Z Z#clllTWTW$XYY Y Z   g&&#e**4=l3w<<#e**455  CJJE s36 A#AA#c t|pddt|}n0#t$r#}t j|jd|d}~wwxYw|_tt|t|z|zt|t|z}|s ||}|S)Create a |ASN.1| object initialized from a string of '0' and '1'. Parameters ---------- value: :class:`str` Text string like '1010111' rrz.fromBinaryString() error: Nrrs r(rzBitString.fromBinaryStringLs ] #q11>>s5zzJJEE ] ] ]#WZWZ$[\\ \ ]   g&&#e**4=l3w<<#e**455  CJJE s25 A"AA"rcttt|d|z t |dz|z }|_tt|t |z|zt |t |z}|s ||}|S)zCreate a |ASN.1| object initialized from a string. Parameters ---------- value: :class:`bytes` Text string like b'\\x01\\xff' big)rrk from_bytesbytesrr)rr&rrpaddings r(fromOctetStringzBitString.fromOctetStringesS^^E%LL%@@GKLLYYZ]^cZdZdghZhkrZrss   g&&#e**4=l3w<<#e**455  CJJE r)ct|tr|St|tr|s"tddS|ddkrq|dddkr|dddS|dddkr|dddSt jd |jr| sd | d D} fd |D}n%#t$rt jd |wxYwt|}d}|D] }|d||z zz}t||dzS| dr|dddS| dr|dddS|dSt|ttfr4dd|DdSt|t"r/t|t%|St|t&rt|St jd|d)Nr'z'BrTrz'HzBad BIT STRING value notation c6g|]}|Sr)striprrs r(rz&BitString.prettyIn..s ===q===r),c*g|]}j|Srr)rnamer%s r(rz&BitString.prettyIn..s!#M#M#MtD$4T$:#M#M#Mr)zunknown bit name(s) in 0xr0bcg|]}|rdpd S)1rr)rbs r(rz&BitString.prettyIn..s!1R1R1Rq!)2Bs1R1R1Rr)z Bad BitString initializer type ') isinstancerrrrrrrr!isdigitsplitrr startswithrlistjoinrrrk)r%r&names bitPositionsrightmostPositionnumber bitPositions` r(rzBitString.prettyInzs) e\ * *7 L s # #5 & I#A33A666qT!!:&&00qtT0RRR233Z5((--eAbDk$-OOO++>CeE! I%--// I==EKK,<,<===T#M#M#M#Mu#M#M#MLLTTT++55,RSSST%( $5$5!#/EEKa$5 $CDDFF#F++889JQ9NOOO!!$'' I))%)D)III!!$'' I,,U122Yt,LLL,,U4,HHH t} - - ((1R1RE1R1R1R)S)Sdh(ii i y ) ) &&33CJJ?? ? s # # && &##;@55B s D"D<)FN)FNr)4rrrrr rrrrrrrrr rr!rr"rrrrrr#rrrrrrrrrrrrCrErKrMr>rArmrrr r rr classmethodrrr&rrr)r(rrUs>>DS^%s':DAAF5*466K'(&((K * * , ,F(//Oo$<<<<6XXXFFFgggiiigggiii    555... %%% www}}}%%%eeemmm   """&&&??? EEE [0[0[(88888r)rcfeZdZdZejejejejdZ e j Z e jZexZZdZefdZdZdZdZdZd Zd Zdd Zed ZedZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dS)raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type :class:`bytes`. When used in Unicode context, |ASN.1| type assumes "|encoding|" serialisation. Keyword Args ------------ value: :class:`unicode`, :class:`str`, :class:`bytes` or |ASN.1| object :class:`bytes`, alternatively :class:`str` representing character string to be serialised into octets (note `encoding` parameter) or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. encoding: :py:class:`str` Unicode codec ID to encode/decode :class:`str` the payload when |ASN.1| object is used in text string context. binValue: :py:class:`str` Binary string initializer to use instead of the *value*. Example: '10110011'. hexValue: :py:class:`str` Hexadecimal string initializer to use instead of the *value*. Example: 'DEADBEEF'. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class Icon(OctetString): ''' ASN.1 specification: Icon ::= OCTET STRING icon1 Icon ::= '001100010011001000110011'B icon2 Icon ::= '313233'H ''' icon1 = Icon.fromBinaryString('001100010011001000110011') icon2 = Icon.fromHexString('313233') rz iso-8859-1c |r}|turt ||d}n#t$rYnwxYw ||d}n#t$rYnwxYw|turQ|jtur||j}n(|jtur||j}d|vr |j|d<tj j ||fi|dS)Nrrencoding) rrrrrrrrDrr"r#r$s r(r#zOctetString.__init__s3   11&**Z2H2HIIEED ..vzz*/E/EFFEED G  #722--d.BCC%W44**4+?@@ V # #!%F:  $T5;;F;;;;;s!(6 AA(A00 A=<A=cZt|tr|St|trN ||jS#t $r&}t jd|d|jd|d}~wwxYwt|tr| St|tj r"| t|St|ttfr"| t|St|S)NzCan't encode string '' with 'z' codec)r6r$rencoderDUnicodeEncodeErrorrPyAsn1UnicodeEncodeErrorrr rr"rrr:rs r(rzOctetString.prettyIns eU # # L s # #  ||DM222%   44$uudmmm569  { + + >>## # t2 3 3 ==U,, , t} - - ==u.. .<< sA A8!A33A8c  |j|jS#t$r8}t jd|jd|jd|jjd|d}~wwxYw)NzCan't decode string 'rFz ' codec at 'r()r.decoderDUnicodeDecodeErrorrPyAsn1UnicodeDecodeErrorrr)r%rs r(rzOctetString.__str__5s} ;%%dm44 4!   00+++t}}} N333569  s! A#3AA#c*t|jSr+r$r.rls r( __bytes__zOctetString.__bytes__@rsr)c*t|jSr+rOrls r(r zOctetString.asOctetsCrsr)c*t|jSr+)rr.rls r(r zOctetString.asNumbersFrsr)c|Sr+rr/s r(rzOctetString.prettyOut[s r)rc||j}||jur|S|}|D]2}|dks|dkr$ddd|DzcS3t|S)N ~r0r2c3 K|] }d|zV dS)z%.2xNrr,s r( z*OctetString.prettyPrint..js&&C&Cavz&C&C&C&C&C&Cr))rr.r r;rr)r%scoper&numbersrs r( prettyPrintzOctetString.prettyPrint^st{++  # #L.."" - -A2vvSbgg&C&C7&C&C&CDDDDDD!&&t,, ,r)cd}d}g}|D]V}|r|dz}nd}||d}|dvrt|}ntjd||||zz}W||t |S)rr"rr)rr4z$Non-binary OCTET STRING initializer )appendrkrrr$)r&bitNobytervs r(rzOctetString.fromBinaryStringos   A  JFF''@AC AJ DD Qxxr)cg}g}|D]/}|r)|t||zdd}-|}0|r&|t|dzdt|S)rrNr)r^rkr$)r&rpras r(rzOctetString.fromHexStrings    A QUB(((  ' HHSS"%% & & &Qxxr)c*t|jSr+rrls r(rzOctetString.__len__rnr)cx|jtur ||j|S|j|Sr+rrr-r.r%rs r(rzOctetString.__getitem__3 ;%  ::dk!n-- -;q> !r)c*t|jSr+iterr.rls r(rzOctetString.__iter__DK   r)c||jvSr+rr/s r( __contains__zOctetString.__contains__ ##r)cb||j||zSr+)r-r.rr/s r(rCzOctetString.__add__s'zz$+ e(<(<<===r)cb||||jzSr+)r-rr.r/s r(rEzOctetString.__radd__s'zz$--..<===r)c<||j|zSr+r,r/s r(rKzOctetString.__mul__r1r)c ||zSr+rr/s r(rMzOctetString.__rmul__rr)c*t|jSr+rjrls r(rmzOctetString.__int__rnr)c*t|jSr+rprls r(rrzOctetString.__float__rsr)c*t|jSr+)rr.rls r(rzOctetString.__reversed__s $$$r)Nr)+rrrrr rrrrrrrrrr"rrrrrrDr#rrrPr r rr[ staticmethodrrrrrrnrCrErKrMrmrrrrr)r(rrs88xS^%s':DAAF5*466K * * , ,F(//OoH$<<<<6   2   """""""""*----"\<\.   """ !!!$$$>>>>>>///   """%%%%%r)rceZdZdZejejejejdZ e j e j dzZ e ZdZdS)raiCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`str` objects (always empty). Keyword Args ------------ value: :class:`str` or |ASN.1| object Python empty :class:`str` literal or any object that evaluates to :obj:`False` If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class Ack(Null): ''' ASN.1 specification: Ack ::= NULL ''' ack = Ack('') r)c|r|SdS)Nr)rr/s r(rz Null.prettyIns  Lsr)N)rrrrr rrrrrrrrrrrrrr)r(rrsHS^%s':DAAF),LJ,LS,Q,QQK " " $ $Fr)rceZdZdZejejejejdZ e j Z e jZdZdZdZdZdZdZd Zd Zd Zd Zd ZdS)ra5Create |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`tuple` objects (tuple of non-negative integers). Keyword Args ------------ value: :class:`tuple`, :class:`str` or |ASN.1| object Python sequence of :class:`int` or :class:`str` literal or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class ID(ObjectIdentifier): ''' ASN.1 specification: ID ::= OBJECT IDENTIFIER id-edims ID ::= { joint-iso-itu-t mhs-motif(6) edims(7) } id-bp ID ::= { id-edims 11 } ''' id_edims = ID('2.6.7') id_bp = id_edims + (11,) c<||j|zSr+r,rs r(rCzObjectIdentifier.__add__8r1r)c<|||jzSr+r,rs r(rEzObjectIdentifier.__radd__;r4r)c|jSr+rrls r(asTuplezObjectIdentifier.asTuple> {r)c*t|jSr+rrls r(rzObjectIdentifier.__len__Crnr)cx|jtur ||j|S|j|Sr+rfrgs r(rzObjectIdentifier.__getitem__Frhr)c*t|jSr+rjrls r(rzObjectIdentifier.__iter__Lrlr)c||jvSr+rr/s r(rnzObjectIdentifier.__contains__Oror)c6|j|Sr+r.indexr%suboids r(rzObjectIdentifier.indexR{  (((r)ct|}|t|kr|jd||d|krdSdS)arIndicate if this |ASN.1| object is a prefix of other |ASN.1| object. Parameters ---------- other: |ASN.1| object |ASN.1| object Returns ------- : :class:`bool` :obj:`True` if this |ASN.1| object is a parent (e.g. prefix) of the other |ASN.1| object or :obj:`False` otherwise. NTFrr%rls r( isPrefixOfzObjectIdentifier.isPrefixOfUsE II E ??{2A2%)++tur)c t|trt|St|trd|vr>t jd|d|jjdtj d td| dDS#t$r,}t jd|d|jjd|d}~wwxYw td|D}n@#ttf$r,}t jd|d|jjd|d}~wwxYwt|t|kr|St jd|d|jj) N-zMalformed Object ID  at : rc0g|]}|t|SrrkrsubOids r(rz-ObjectIdentifier.prettyIn..s#SSSfFSc&kkSSSr).c8g|]}|dkt|Srrrs r(rz-ObjectIdentifier.prettyIn..z# P P PFaKKVKKKr))r6rrrrrrrsysexc_infor8r TypeErrorrr%r&r tupleOfIntss r(rzObjectIdentifier.prettyInis e- . . <<  s # # e||'':?%%AXAXAXZ]ZfZhZhijZkZkl SS C8H8HSSSTTT   '':?%%AXAXAXZ]Z]^    P P5 P P PQQKKI&   ##6;eeT^=T=T=TVYVYZ   {  s5zz ) ) %%%I`I` abbb0=+B)) C3'CC#C==D:'D55D:c@dd|DS)Nrc,g|]}t|Srrr,s r(rz.ObjectIdentifier.prettyOut..///AQ///r)r;r/s r(rzObjectIdentifier.prettyOut#xx/////000r)Nrrrrr rrrrrrrrrr"rrrCrErrrrrnrrrrrr)r(rrs((XS^%s':DAAF5*466K * * , ,F//////    """ !!!$$$)))(ccc:11111r)rceZdZdZejejejejdZ e j Z e jZdZdZdZdZdZdZd Zd Zd Zd Zd ZdS) RelativeOIDa[Create |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`tuple` objects (tuple of non-negative integers). Keyword Args ------------ value: :class:`tuple`, :class:`str` or |ASN.1| object Python sequence of :class:`int` or :class:`str` literal or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class RelOID(RelativeOID): ''' ASN.1 specification: id-pad-null RELATIVE-OID ::= { 0 } id-pad-once RELATIVE-OID ::= { 5 6 } id-pad-twice RELATIVE-OID ::= { 5 6 7 } ''' id_pad_null = RelOID('0') id_pad_once = RelOID('5.6') id_pad_twice = id_pad_once + (7,) c<||j|zSr+r,rs r(rCzRelativeOID.__add__r1r)c<|||jzSr+r,rs r(rEzRelativeOID.__radd__r4r)c|jSr+rrls r(rzRelativeOID.asTuplerr)c*t|jSr+rrls r(rzRelativeOID.__len__rnr)cx|jtur ||j|S|j|Sr+rfrgs r(rzRelativeOID.__getitem__rhr)c*t|jSr+rjrls r(rzRelativeOID.__iter__rlr)c||jvSr+rr/s r(rnzRelativeOID.__contains__ror)c6|j|Sr+rrs r(rzRelativeOID.indexrr)ct|}|t|kr|jd||d|krdSdS)apIndicate if this |ASN.1| object is a prefix of other |ASN.1| object. Parameters ---------- other: |ASN.1| object |ASN.1| object Returns ------- : :class:`bool` :obj:`True` if this |ASN.1| object is a parent (e.g. prefix) of the other |ASN.1| object or :obj:`False` otherwise. NTFrrs r(rzRelativeOID.isPrefixOfsE II E ??{2A2%)++tur)c t|trt|St|trd|vr>t jd|d|jjdtj d td| dDS#t$r,}t jd|d|jjd|d}~wwxYw td|D}n@#ttf$r,}t jd|d|jjd|d}~wwxYwt|t|kr|St jd|d|jj) NrzMalformed RELATIVE-OID rrrc0g|]}|t|Srrrs r(rz(RelativeOID.prettyIn..rr)rc8g|]}|dkt|Srrrs r(rz(RelativeOID.prettyIn..rr))r6rrrrrrrrrr8rrrrs r(rzRelativeOID.prettyIns e[ ) ) <<  s # # e||''=BUUDND[D[D[]`]i]k]klm]n]no SS C8H8HSSSTTT   ''=BUUDND[D[D[]`]`a    P P5 P P PQQKKI&   ##9>@W@W@WY\Y\]   {  s5zz ) ) UUUDNLcLc deeerc@dd|DS)Nrc,g|]}t|Srrr,s r(rz)RelativeOID.prettyOut..rr)rr/s r(rzRelativeOID.prettyOutrr)Nrrr)r(rrs  HS^%s':DAAF5*466K * * , ,F//////    """ !!!$$$)))$fff:11111r)rcbeZdZdZdZ edZedZeefZn#e $r dxZZdZYnwxYwe j e j e j e jdZejZejZedZdZd0d Zed Zed Zed ZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&d1dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0d Z1d0d!Z2d"Z3d#Z4d$Z5d%Z6d&Z7d'Z8d(Z9d)Z:d*Z;d+Zd-Z?d.Z@d/ZAdS)2rabCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`float` objects. Additionally, |ASN.1| objects behave like a :class:`tuple` in which case its elements are mantissa, base and exponent. Keyword Args ------------ value: :class:`tuple`, :class:`float` or |ASN.1| object Python sequence of :class:`int` (representing mantissa, base and exponent) or :class:`float` instance or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class Pi(Real): ''' ASN.1 specification: Pi ::= REAL pi Pi ::= { mantissa 314159, base 10, exponent -5 } ''' pi = Pi((314159, 10, -5)) Ninfz-infr cX|\}}}|r|dzdkr|dz}|dz }|r |dzdk|||fS)N rrr)r&mr5es r(__normalizeBase10zReal.__normalizeBase10QsV1a AFaKK GA FA AFaKK!Qwr)ct|trt|dkrt|dttfr6t|dtrt|dtst jd|t|dtr|jr|d|jvr|dS|ddvrt jd|d|ddkr||}|St|tr||ddfSt|tst|trt|tr6 t |}n%#t$rt jd |wxYw|jr ||jvr|Sd}t||kr|dz}|dz}t||k|t|d|fSt|trt|St jd |) NrrrrzLame Real value syntax: )rrz Prohibited base for Real value: rzBad real value syntax: ) r6rrrkrqrr_inf_Real__normalizeBase10rrr)r%r&rs r(rz Real.prettyInYs eU # #" E auQx#u66 Q"58S11 Q"58S11 Q''(OPPP58U++ I "'(di"7"7QxQxw&&''y CUdi// %jjE))RKEFA%jjE))--s5zz2q.ABBB t $ $ << +05 2   s F"F;rcj |t|S#t$rYdSwxYw)Nz )rrq OverflowError)r%rYs r(r[zReal.prettyPrintsA >>%++.. .   << s !$ 22c"|j|jkS)zIndicate PLUS-INFINITY object value Returns ------- : :class:`bool` :obj:`True` if calling object represents plus infinity or :obj:`False` otherwise. )r._plusInfrls r( isPlusInfzReal.isPlusInfs{dm++r)c"|j|jkS)zIndicate MINUS-INFINITY object value Returns ------- : :class:`bool` :obj:`True` if calling object represents minus infinity or :obj:`False` otherwise. )r. _minusInfrls r( isMinusInfzReal.isMinusInfs{dn,,r)c|j|jvSr+)r.rrls r(isInfz Real.isInfs{di''r)cL|t||zSr+r-rqr/s r(rCz Real.__add__zz%++-...r)c ||zSr+rr/s r(rEz Real.__radd__rr)cL|t||zSr+rr/s r(rKz Real.__mul__rr)c ||zSr+rr/s r(rMz Real.__rmul__rr)cL|t||z Sr+rr/s r(rGz Real.__sub__rr)cL||t|z Sr+rr/s r(rIz Real.__rsub__zz%%++-...r)cL|t||zSr+rr/s r(rOz Real.__mod__rr)cL||t|zSr+rr/s r(rQz Real.__rmod__rr)cd|tt|||Sr+r-rTrqrUs r(rWz Real.__pow__s&zz#eDkk5&99:::r)cb|t|t|Sr+rr/s r(rYz Real.__rpow__s$zz#eU4[[11222r)cL|t||z Sr+rr/s r(r`zReal.__truediv__rr)cL||t|z Sr+rr/s r(rbzReal.__rtruediv__rr)cL|t||zSr+rr/s r(rfzReal.__divmod__szz%++.///r)cL||t|zSr+rr/s r(rhzReal.__rdivmod__szz%5;;.///r)c:tt|Sr+)rkrqrls r(rmz Real.__int__s5;;r)c|j|jvr|jSt|jdt|jd|jdzS)Nrrr)r.rrqrTrls r(rrzReal.__float__sO ;$) # #;  AT[^T[^!D!DD r)c`|tt|Sr+)r-rurqrls r(rvz Real.__abs__s"zz#eDkk**+++r)cH|t| Sr+rrls r(rzz Real.__pos__zz5;;,'''r)cH|t| Sr+rrls r(r}z Real.__neg__rr)cntt||}|r||S|Sr+)rrqr-rs r(rzReal.__round__s4 %++q ! !  ::a== Hr)cj|tjt|Sr+)r-rrrqrls r(rzReal.__floor__$zz$*U4[[11222r)cj|tjt|Sr+)r-rrrqrls r(rz Real.__ceil__s$zz$)E$KK00111r)cj|tjt|Sr+)r-rrrqrls r(rzReal.__trunc__rr)c(t||kSr+rqr/s r(rz Real.__lt__T{{U""r)c(t||kSr+rr/s r(rz Real.__le__T{{e##r)c(t||kSr+rr/s r(rz Real.__eq__rr)c(t||kSr+rr/s r(rz Real.__ne__rr)c(t||kSr+rr/s r(rz Real.__gt__rr)c(t||kSr+rr/s r(rz Real.__ge__rr)c:tt|Sr+)boolrqrls r(__bool__z Real.__bool__sE$KK   r)c`|j|jvrtjd|j|S)Nz Invalid infinite value operation)r.rrrr%idxs r(rzReal.__getitem__ s0 ;$) # ##$FGG G;s# #r)c|jSr+)rrls r(isPlusInfinityzReal.isPlusInfinity ~r)c|jSr+)rrls r(isMinusInfinityzReal.isMinusInfinitys r)c|jSr+)rrls r( isInfinityzReal.isInfinitys zr)rr+)Brrrr binEncBaserqrrrrr rrrrrrrrrr"rrrwrrr[propertyrrrrCrErKrMrGrIrOrQrWrYr`rbrfrhrmrrrvrzr}rrrrrrrrrrrrrrrrrr)r(rr sx))TJ5<<E&MM " ##9S^%s':DAAF5*466K * * , ,F\& & & P     , ,X , - -X -((X(//////////////////;;;;333//////000000   ,,,((((((333222333###$$$$$$$$$###$$$!!!"+H$$$s % 33rceZdZdZejejejejdZ e j Z e ZejZdS)raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python :class:`int` or :class:`str` literal or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class RadioButton(Enumerated): ''' ASN.1 specification: RadioButton ::= ENUMERATED { button1(0), button2(1), button3(2) } selected-by-default RadioButton ::= button1 ''' namedValues = NamedValues( ('button1', 0), ('button2', 1), ('button3', 2) ) selected_by_default = RadioButton('button1') rN)rrrrr rrrrrrrrr rrr rr!rr)r(rrs~//fS^%s':DAAF5*466K   F'(&((KKKr)rceZdZdZdZdZdZdZdZdZ dd Z d Z dd Z dZ dZdZedfdZedddfdZedZedZdZdZddZddZedZedZd S)ra<Create |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.ConstructedAsn1Type`, its objects are mutable and duck-type Python :class:`list` objects. Keyword Args ------------ componentType : :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A pyasn1 object representing ASN.1 type allowed within |ASN.1| type tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type can only occur on explicit `.isInconsistent` call. Examples -------- .. code-block:: python class LotteryDraw(SequenceOf): # SetOf is similar ''' ASN.1 specification: LotteryDraw ::= SEQUENCE OF INTEGER ''' componentType = Integer() lotteryDraw = LotteryDraw() lotteryDraw.extend([123, 456, 789]) c|r3td|D]"\}}||vrtjd||d<#t|_t jj|fi|dS)N) componentTyperrz*Conflicting positional and keyword params!r)ziprrr_componentValuesrConstructedAsn1Typer#)r%argsr'keyr&s r(r#zSequenceOfAndSetOfBase.__init__s  0!#23799 0 0 U&==+,XYYY*/'' '  )$99&99999r)cz ||S#tj$r}t|d}~wwxYwr+)getComponentByPositionrrrr%rrs r(rz"SequenceOfAndSetOfBase.__getitem__sI "..s33 3  " " "S// ! "s:5:c |||dS#tj$r}t|d}~wwxYwr+)setComponentByPositionrrrr%rr&rs r( __setitem__z"SequenceOfAndSetOfBase.__setitem__sQ "  ' 'U 3 3 3 3 3  " " "S// ! "s=8=cZ|jturd}nt|j}|||<dSr)r rr)r%r&poss r(r^zSequenceOfAndSetOfBase.appends6  G + +CCd+,,CS r)ctt|j|Sr+)r:r valuesrr/s r(rzSequenceOfAndSetOfBase.counts-D)00223399%@@@r)ch|D]}|||jtur i|_dSdSr+)r^r r)r%rr&s r(extendzSequenceOfAndSetOfBase.extendsJ  E KK      G + +$&D ! ! ! , +r)rNc|t|}t|j\}}t |} |||||S#t j$r}t|d}~wwxYwr+) rrr itemsr:rrrr)r%r&startstoprrrs r(rzSequenceOfAndSetOfBase.indexs <t99Dt4::<<=f "6<<ud;;< <  " " "S// ! "sA""B1BBc8|jdSr+)r reverserls r(rzSequenceOfAndSetOfBase.reverses %%'''''r)Fc ttt|j|||_dS)N)r r)dict enumeratesortedr r)r%r rs r(sortzSequenceOfAndSetOfBase.sortsN $ fT299;;!$g777 8 8!9!9r)c^|jtus|jsdSt|jdzS)Nrr)r rrrls r(rzSequenceOfAndSetOfBase.__len__s3  G + +43H +14())A--r)c#xKtdt|D]}||VdSr)rrrrs r(rzSequenceOfAndSetOfBase.__iter__sLCII&& 3 3C--c22 2 2 2 2 3 3r)c0|jD]{\}}|turmt|tjr+||||S||||dSNcloneValueFlag)r rrr6rr rr-r%myCloner*rcomponentValues r(_cloneComponentValuesz,SequenceOfAndSetOfBase._cloneComponentValuess#'#8#>#>#@#@ P P CW,,nd.FGGP22^111PP2238L8L8N8NOOO P Pr)Tct|tr?ttt }fd||DS|dkr,t |z}|dkrt jd j|}nD#tt jf$r+scYS |j|}YnwxYwtus|j r|SS)a2Return |ASN.1| type component value by position. Equivalent to Python sequence subscription operation (e.g. `[]`). Parameters ---------- idx : :class:`int` Component index (zero-based). Must either refer to an existing component or to N+1 component (if *componentType* is set). In the latter case a new component type gets instantiated and appended to the |ASN.1| sequence. Keyword Args ------------ default: :class:`object` If set and requested component is a schema object, return the `default` object instead of the requested component. instantiate: :class:`bool` If :obj:`True` (default), inner component will be automatically instantiated. If :obj:`False` either existing component or the :class:`NoValue` object will be returned. Returns ------- : :py:class:`~pyasn1.type.base.PyAsn1Item` Instantiate |ASN.1| component type or return existing component value Examples -------- .. code-block:: python # can also be SetOf class MySequenceOf(SequenceOf): componentType = OctetString() s = MySequenceOf() # returns component #0 with `.isValue` property False s.getComponentByPosition(0) # returns None s.getComponentByPosition(0, default=None) s.clear() # returns noValue s.getComponentByPosition(0, instantiate=False) # sets component #0 to OctetString() ASN.1 schema # object and returns it s.getComponentByPosition(0, instantiate=True) # sets component #0 to ASN.1 value object s.setComponentByPosition(0, 'ABCD') # returns OctetString('ABCD') value object s.getComponentByPosition(0, instantiate=False) s.clear() # returns noValue s.getComponentByPosition(0, instantiate=False) c>g|]}|Sr)r)rsubidxdefault instantiater%s r(rzASequenceOfAndSetOfBase.getComponentByPosition..%s;000//MM000r)r&SequenceOf/SetOf index is out of range) r6rrrrrrr rrrisValue)r%rr2r3rr-s` `` r(rz-SequenceOfAndSetOfBase.getComponentByPositions6D c5 ! ! 0E#d)),,--G000000")#,000 0 77d))c/CQww'<>>> 8!237NN%+, 8 8 8   ' ' , , ,!237NNN  8 g  !7 ! !Ns BC5"CCcrt|trnttt |}|r||dpd}t |D]!\}} |||z| |||"|S|dkr,t ||z}|dkrtjd|j } |j turi} n|j } | |t} |tur6| | }n| turtjdnt|tjs| 1t| tjr| |}n| tur1t| tjr| |}nutjd|d|| Y|s|rU|jr| jp| j} | ||o||o|s/| jt*jkrtjd|d | || |<| |_ |S) aAssign |ASN.1| type component by position. Equivalent to Python sequence item assignment operation (e.g. `[]`) or list.append() (when idx == len(self)). Parameters ---------- idx: :class:`int` Component index (zero-based). Must either refer to existing component or to N+1 component. In the latter case a new component type gets instantiated (if *componentType* is set, or given ASN.1 object is taken otherwise) and appended to the |ASN.1| sequence. Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. If `value` is not given, schema object will be set as a component. verifyConstraints: :class:`bool` If :obj:`False`, skip constraints validation matchTags: :class:`bool` If :obj:`False`, skip component tags matching matchConstraints: :class:`bool` If :obj:`False`, skip component constraints matching Returns ------- self Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer IndexError When idx > len(self) rr4NComponent type not definedr&zNon-ASN.1 value z! and undefined component type at %Component value is tag-incompatible:  vs )r6rrrrr"rrrrr rgetr-rAsn1Itemr"strictConstraintsisSameTypeWith isSuperTypeOfrr)r%rr&verifyConstraints matchTagsmatchConstraintsrstartIdxsubIdxsubValuercomponentValues currentValuesubtypeCheckers r(rz-SequenceOfAndSetOfBase.setComponentByPosition>sX c5 ! ! E#d)),,--G273<?7aH$-e$4$4 1 1 ++v%x1B/1111K 77d))c/CQww'<>>>*  G + + OO#3O&**388 G  (%++--(('(DEEE)E4=11 7)}d.ABB*%++%+88g--|T-@AA.$***77''%*UUDD2333 &I &9I &*1!00!/  ">%):)Hy"3"H8HJJ 7!'3:55++ %}}6777 % / r)c,|j |jjSdSr+)rtagMaprls r(componentTagMapz&SequenceOfAndSetOfBase.componentTagMaps   )%, , * )r)cDfdtjDS)Nc*g|]}j|Srr rrr%s r(rz5SequenceOfAndSetOfBase.components..s1:::%c*:::r))r#r rls`r( componentsz!SequenceOfAndSetOfBase.componentss9::::!$"788::: :r)ci|_|S)zRemove all components and become an empty |ASN.1| value object. Has the same effect on |ASN.1| object as it does on :class:`list` built-in. rNrls r(clearzSequenceOfAndSetOfBase.clears !# r)ct|_|SzRemove all components and become a |ASN.1| schema object. See :meth:`isValue` property for more information on the distinction between value and schema objects. )rr rls r(resetzSequenceOfAndSetOfBase.resets !( r)c|dz }|jjdz}|js|St|D];\}}|d|zz }|tur |j|dz }#|||z }<|S)Nr:  z)rrr5r"rrr[r%rYrepresentationrr-s r(r[z"SequenceOfAndSetOfBase.prettyPrints  058| "! !#,T?? D D C cEk )N'))&2)+."<"  { rX })rrrrprettyPrintType)r%rYrZs r(r`z&SequenceOfAndSetOfBase.prettyPrintTypesv  +/;;;8O8O8OP   ) cEk )N d0@@GG GN$seai'883>>r)c|jturdSt|jt|krdS|jD]}|tus|jsdSdS)arIndicate that |ASN.1| object represents ASN.1 value. If *isValue* is :obj:`False` then this object represents just ASN.1 schema. If *isValue* is :obj:`True` then, in addition to its ASN.1 schema features, this object can also be used like a Python built-in object (e.g. :class:`int`, :class:`str`, :class:`dict` etc.). Returns ------- : :class:`bool` :obj:`False` if object represents just ASN.1 schema. :obj:`True` if object represents ASN.1 schema and can be used as a normal value. Note ---- There is an important distinction between PyASN1 schema and value objects. The PyASN1 schema objects can only participate in ASN.1 schema-related operations (e.g. defining or testing the structure of the data). Most obvious uses of ASN.1 schema is to guide serialisation codecs whilst encoding/decoding serialised ASN.1 contents. The PyASN1 value objects can **additionally** participate in many operations involving regular Python objects (e.g. arithmetic, comprehension etc). FT)r rrrr5r%r-s r(r5zSequenceOfAndSetOfBase.isValues|6  G + +5 t$ % %T 2 25"3::<<  N((0F(uu)tr)c|jtus|jsdS|jturdSi}|jD]\}}|tur|||< ||n#t j$r }|cYd}~Sd}~wwxYwdSaRun necessary checks to ensure |ASN.1| object consistency. Default action is to verify |ASN.1| object against constraints imposed by `subtypeSpec`. Raises ------ :py:class:`~pyasn1.error.PyAsn1tError` on any inconsistencies found FTN)rrrr rrr)r%mappingrr&rs r(isInconsistentz%SequenceOfAndSetOfBase.isInconsistent s   ( (0@ (5  G + +4/5577 ! !JC GCLL    W % % % %    JJJJJJ usA//B >B?B B )rNNFr)rrrrr#rrr^rrrrr$rrr.rrrrrKrPrRrUr[r`r5rfrr)r(rrcs!!D : : :""""""AAA''' " " " "(((9999 ... 333PPP3:t[[[[z1815)-04mmmm^--X-::X:"????$$X$L  X   r)rceZdZejZejejejej dZ dZ e j ZeZdS)rrNrrrrrr rrrtagFormatConstructedrrrrrrrrr)r(rr-p$,G S^%s'?FFF M 5*466K$ - - / /FFFr)rceZdZejZejejejej dZ dZ e j ZeZdS)rNrirr)r(rrDrkr)rc6eZdZdZejZGddeZdZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZdZedZdZedfdZedddfdZedfdZedddfdZedZedZd dZd dZ dZ!dZ"dZ#dS)!raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.ConstructedAsn1Type`, its objects are mutable and duck-type Python :class:`dict` objects. Keyword Args ------------ componentType: :py:class:`~pyasn1.type.namedtype.NamedType` Object holding named ASN.1 types allowed within this collection tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type can only occur on explicit `.isInconsistent` call. Examples -------- .. code-block:: python class Description(Sequence): # Set is similar ''' ASN.1 specification: Description ::= SEQUENCE { surname IA5String, first-name IA5String OPTIONAL, age INTEGER DEFAULT 40 } ''' componentType = NamedTypes( NamedType('surname', IA5String()), OptionalNamedType('first-name', IA5String()), DefaultedNamedType('age', Integer(40)) ) descr = Description() descr['surname'] = 'Smith' descr['first-name'] = 'John' cBeZdZdZdZdZdZdZdZdZ dZ d Z d S) SequenceAndSetBase.DynamicNamesz9Fields names/positions mapping for component-less objectsc"i|_i|_dSr+ _keyToIdxMap _idxToKeyMaprls r(r#z(SequenceAndSetBase.DynamicNames.__init__s "D  "D   r)c*t|jSr+)rrsrls r(rz'SequenceAndSetBase.DynamicNames.__len__st()) )r)c&||jvp||jvSr+rrr%items r(rnz,SequenceAndSetBase.DynamicNames.__contains__s4,,I8I0I Ir)c^fdttjDS)Nc32K|]}j|VdSr+)rtrOs r(rXz;SequenceAndSetBase.DynamicNames.__iter__..s+TTsD%c*TTTTTTr))rrrtrls`r(rz(SequenceAndSetBase.DynamicNames.__iter__s0TTTTeC@QdSr+)rrrrrr/rs r(rzSequenceAndSetBase.itemss/J3t7I3J3JKK 9 9C% 9(-2DI=====(-tCy88888  9 9r)c@|D] \}}|||< |D] }||||<dSr+r)r% iterValue mappingValuekras r(updatezSequenceAndSetBase.updatesH  DAqDGG & &A"1oDGG & &r)cFg|_||_|S)zRemove all components and become an empty |ASN.1| value object. Has the same effect on |ASN.1| object as it does on :class:`dict` built-in. )r rrrls r(rRzSequenceAndSetBase.clear s% !#!..00 r)cPt|_||_|SrT)rr rrrls r(rUzSequenceAndSetBase.reset s% !(!..00 r)c|jSr+rNrls r(rPzSequenceAndSetBase.components s $$r)cF|jturdSt|jD]{\}}|turmt|tjr+||||S||||dSr()r rr"r6rr rr-r+s r(r.z(SequenceAndSetBase._cloneComponentValues s  G + + F#,T-B#C#C P P CW,,nd.FGGP22^111PP2238L8L8N8NOOO P Pr)Tc|jr|j|}nB |j|}n&#t$rt jd|dwxYw||||S)apReturns |ASN.1| type component by name. Equivalent to Python :class:`dict` subscription operation (e.g. `[]`). Parameters ---------- name: :class:`str` |ASN.1| type component name Keyword Args ------------ default: :class:`object` If set and requested component is a schema object, return the `default` object instead of the requested component. instantiate: :class:`bool` If :obj:`True` (default), inner component will be automatically instantiated. If :obj:`False` either existing component or the :class:`NoValue` object will be returned. Returns ------- : :py:class:`~pyasn1.type.base.PyAsn1Item` Instantiate |ASN.1| component type or return existing component value rrr2r3)rrrrrrrr)r%r/r2r3rs r(rz%SequenceAndSetBase.getComponentByName' s8  ! G$66t<#t$r1t} |r%||krt jdtg|z}YnwxYw|turs|rR||}t|tj r!| ||j }np| turt jdnQt|tj s|rg||} t| tjr| |}nt jd|jjz| tur1t| tjr| |}nt jd|jjz|s|s|rm|rk||} | turM|jr| jp| j} | ||o||o|s'||jst jd|d||s ||jvr|||<nWt-||kr0|||j|nt jd ||_|S) aAssign |ASN.1| type component by position. Equivalent to Python sequence item assignment operation (e.g. `[]`). Parameters ---------- idx : :class:`int` Component index (zero-based). Must either refer to existing component (if *componentType* is set) or to N+1 component otherwise. In the latter case a new component of given ASN.1 type gets instantiated and appended to |ASN.1| sequence. Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. If `value` is not given, schema object will be set as a component. verifyConstraints : :class:`bool` If :obj:`False`, skip constraints validation matchTags: :class:`bool` If :obj:`False`, skip component tags matching matchConstraints: :class:`bool` If :obj:`False`, skip component constraints matching Returns ------- self zcomponent index out of ranger)r7r8z%s can cast only scalar valuesz%s undefined component typer9r:zComponent index out of range)rrr rrrrgetTypeByPositionr6rr r- isDefaultedr<r"rrr=r>r?openTyperrr^r) r%rr&r@rArBrcomponentTypeLenrFrGsubComponentTyperHs r(rz)SequenceAndSetBase.setComponentByPosition s8H* 1  G + + OO#3O ?*3/LL ? ? ?"L ?#c))+,JKKK#*).>">  ? G   F%77<<eT%=>>W!KK}S7I7UKVVE(('(DEEE)E4=11 z j#0#B#B3#G#G .0CDDq,222??EE +,L}OfOo,opppW,,L$J]1^1^,$***77'(E H_Hh(hiii zI z1A z z,>>sCC w.."&"8#B"2"A#A"2"@&~e->-L9&7&L\}}|js|jr|jsdS|j|}|tus|jsdS?n|jD]}|tus|jsdSdS)aIndicate that |ASN.1| object represents ASN.1 value. If *isValue* is :obj:`False` then this object represents just ASN.1 schema. If *isValue* is :obj:`True` then, in addition to its ASN.1 schema features, this object can also be used like a Python built-in object (e.g. :class:`int`, :class:`str`, :class:`dict` etc.). Returns ------- : :class:`bool` :obj:`False` if object represents just ASN.1 schema. :obj:`True` if object represents ASN.1 schema and can be used as a normal value. Note ---- There is an important distinction between PyASN1 schema and value objects. The PyASN1 schema objects can only participate in ASN.1 schema-related operations (e.g. defining or testing the structure of the data). Most obvious uses of ASN.1 schema is to guide serialisation codecs whilst encoding/decoding serialised ASN.1 contents. The PyASN1 value objects can **additionally** participate in many operations involving regular Python objects (e.g. arithmetic, comprehension etc). It is sufficient for |ASN.1| objects to have all non-optional and non-defaulted components being value objects to be considered as a value objects as a whole. In other words, even having one or more optional components not turned into value objects, |ASN.1| object is still considered as a value object. Defaulted components are normally value objects by default. FT)r rrr" namedTypesr isOptionalr5)r%rrrr-s r(r5zSequenceAndSetBase.isValueE sD  G + +5*  !)2=3K)L)L ! !%%#/3C3N,! 55!%!6s!;!W,,N4J, 55- !#'"7 ! !!W,,N4J, 55-tr)cH|jtus|jsdS|jturdSi}t |jD].\}}|tur|j|}|||</ ||n#t j$r }|cYd}~Sd}~wwxYwdSrd)rrrr r"r}rr)r%rerr&r/rs r(rfz!SequenceAndSetBase.isInconsistent s   ( (0@ (5  G + +4#D$9:: " "JC%77<$>u$E$E$E$E"r)c|dz }|jd|jjd}t|jp|jD]p\}}|d|zz }|jr!|d|j|zz }n |d|j|zz }|d| |d}q|dzd|dz zzdzS) Nrr\r]rXz"%s"z = r^r_) rrrr"rrr r}rr`)r%rYrZrrs r(r`z"SequenceAndSetBase.prettyPrintType s  +/;;;8O8O8OP"+D,>,E,E,G,G,`4K`"a"a   C cEk )N! U&4+=+O+OPS+T+T"TT&4+=+O+OPS+T+T"TT = =e D D D DNN$seai'883>>r)c|Sr+rrls r(setDefaultComponentsz'SequenceAndSetBase.setDefaultComponents  r)c"|jr|jSdSr+)rrrls r(getComponentTypez#SequenceAndSetBase.getComponentType s  ! &% % & &r)c8|jr|j|jSdSr+)rrr/rs r(r}z$SequenceAndSetBase.getNameByPosition s(  ! 0%c*/ / 0 0r)Nr)$rrrrr NamedTypesrobjectrr#rrrnrrrrrrrRrUrrPr.rrrrrr5rfr[r`rrr}rr)r(rr[sW**Z)I(**M&6&6&6&6&6v&6&6&6RKKK&&&"&&&"--- ***>>> 999&&& %%X% P P P07D%Z%Z%Z%ZN.5-1%),0, , , , \3:t\\\\|1815)-04iiiiV77X7r""X"H, ? ? ? ? &&&00000r)rceZdZejZejejejej dZ e j Z ejZeZdZdZdS)rrcH|jr|j|SdSr+)rgetTagMapNearPositionrs r(getComponentTagMapNearPositionz'Sequence.getComponentTagMapNearPosition s1   A%;;C@@ @ A Ar)cJ|jr|j||S|Sr+)rgetPositionNearType)r%rrs r(getComponentPositionNearTypez%Sequence.getComponentPositionNearType s+   %99&#FF FJr)N)rrrrrr rrrrjrrrrrrrrrrrrr)r(rr s (G S^%s'?FFF5*466K)I(**M ) ) + +FAAAr)rceZdZejZejejejej dZ e j Z ejZeZd dZeddfdZeddddfdZedZdS) rrmFc|Sr+r)r% innerFlags r( getComponentzSet.getComponent rr)Tc||j|||}|r+t|tr|dS|S)a8Returns |ASN.1| type component by ASN.1 tag. Parameters ---------- tagSet : :py:class:`~pyasn1.type.tag.TagSet` Object representing ASN.1 tags to identify one of |ASN.1| object component Keyword Args ------------ default: :class:`object` If set and requested component is a schema object, return the `default` object instead of the requested component. instantiate: :class:`bool` If :obj:`True` (default), inner component will be automatically instantiated. If :obj:`False` either existing component or the :class:`noValue` object will be returned. Returns ------- : :py:class:`~pyasn1.type.base.PyAsn1Item` a pyasn1 object rTr)rrgetPositionByTyper6rr)r%rr2r3rr-s r(getComponentByTypezSet.getComponentByType sq644   0 0 8 85    "NC88 "!...>> >" !r)c@|j|}|rj|j|}|jr||||||S||}|||||||S||||||S)a!Assign |ASN.1| type component by ASN.1 tag. Parameters ---------- tagSet : :py:class:`~pyasn1.type.tag.TagSet` Object representing ASN.1 tags to identify one of |ASN.1| object component Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. If `value` is not given, schema object will be set as a component. verifyConstraints : :class:`bool` If :obj:`False`, skip constraints validation matchTags: :class:`bool` If :obj:`False`, skip component tags matching matchConstraints: :class:`bool` If :obj:`False`, skip component constraints matching innerFlag: :class:`bool` If :obj:`True`, search for matching *tagSet* recursively. Returns ------- self r)rrrrrrsetComponentByType) r%rr&r@rArBrrrs r(rzSet.setComponentByType7 sH 226::   .@@EEM# 22 19>N!% ; ;C @ @ $77E#4iAQ]f8..U-y:J r)c,|jr |jjSdSr+)r tagMapUniquerls r(rKzSet.componentTagMapn s#   3%2 2 3 3r)NF)rrrrrr rrrrjrrrrrrrrrrrrrrrKrr)r(rr s (G S^%s'?FFF )I(**M 5*466K ) ) + +F29'+u$"$"$"$"L07-1%),0%* 5555n33X333r)rceZdZdZejZejZ e j e j ddZ eZdZdZdZdZdZdZd Zd Zd Zd Zd ZdZdZdZdZdZ e!dfdZ"e!dddfdZ#e$dZ%e$dZ&ddZ'ddZ(e$dZ)dZ*dZ+dS)raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.ConstructedAsn1Type`, its objects are mutable and duck-type Python :class:`list` objects. Keyword Args ------------ componentType: :py:class:`~pyasn1.type.namedtype.NamedType` Object holding named ASN.1 types allowed within this collection tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type can only occur on explicit `.isInconsistent` call. Examples -------- .. code-block:: python class Afters(Choice): ''' ASN.1 specification: Afters ::= CHOICE { cheese [0] IA5String, dessert [1] IA5String } ''' componentType = NamedTypes( NamedType('cheese', IA5String().subtype( implicitTag=Tag(tagClassContext, tagFormatSimple, 0) ), NamedType('dessert', IA5String().subtype( implicitTag=Tag(tagClassContext, tagFormatSimple, 1) ) ) afters = Afters() afters['cheese'] = 'Mascarpone' rNcJ|jr|j|j|kStSr+r  _currentIdxNotImplementedrs r(rz Choice.__eq__ *   D()9:eC Cr)cJ|jr|j|j|kStSr+rrs r(rz Choice.__ne__ rr)cJ|jr|j|j|kStSr+rrs r(rz Choice.__lt__ *   C()9:UB Br)cJ|jr|j|j|kStSr+rrs r(rz Choice.__le__ rr)cJ|jr|j|j|kStSr+rrs r(rz Choice.__gt__ rr)cJ|jr|j|j|kStSr+rrs r(rz Choice.__ge__ rr)c*t|jSr+)rr rls r(rzChoice.__bool__ sD)***r)c|jdurdpdS)Nrr)rrls r(rzChoice.__len__ st+16Q6r)cd|jdS||j|jkSrgrrgetNamers r(rnzChoice.__contains__ s2   #5d()9:BBDDDDr)c#rK|jt|j|jVdSr+)r StopIterationrrrls r(rzChoice.__iter__ s>   #  !12::<<<<<<>@@ @ @ @ @ @ ( 'r)c#K|j5|j|j||jfVdSdSr+rrls r(rz Choice.items sM   '$T%56>>@@$tGWBXX X X X X X ( 'r)c<|jtjddS)NComponent not chosen)rrrrls r(checkConsistencyzChoice.checkConsistency s%   ##$:;; ; $ #r)c |}t|tr|j}n|j}t|t jr,||||dS|||dS#tj $rYdSwxYwr() rr6reffectiveTagSetrrr rr-rr)r%r,r* componentrs r(r.zChoice._cloneComponentValues s F))++I)V,, *"2"))T%=>> F**IOO>OJJ**69??3D3DEEEEE     DD sB**B=<B=Tctj}|j |j|krt||||S|j|S)Nr)rrrrr )r%rr2r3rs r(rzChoice.getComponentByPosition sX+   #t'73'>'>--dC:E.GG G$S))r)c|j}t||||||||_|||krt|j|<|S)a Assign |ASN.1| type component by position. Equivalent to Python sequence item assignment operation (e.g. `[]`). Parameters ---------- idx: :class:`int` Component index (zero-based). Must either refer to existing component or to N+1 component. In the latter case a new component type gets instantiated (if *componentType* is set, or given ASN.1 object is taken otherwise) and appended to the |ASN.1| sequence. Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. Once a new value is set to *idx* component, previous value is dropped. If `value` is not given, schema object will be set as a component. verifyConstraints : :class:`bool` If :obj:`False`, skip constraints validation matchTags: :class:`bool` If :obj:`False`, skip component tags matching matchConstraints: :class:`bool` If :obj:`False`, skip component constraints matching Returns ------- self )rrrrr )r%rr&r@rArBoldIdxs r(rzChoice.setComponentByPosition sUJ! ""4e5F Scddd  &C--,3D !& ) r)cT|jr|jS|}|jS)zwReturn a :class:`~pyasn1.type.tag.TagSet` object of the currently initialized component or self (if |ASN.1| is tagged).)rrr)r%rs r(rzChoice.effectiveTagSet< s0 ; -; ))++I, ,r)cf|jrtj|S|jjSz"Return a :class:`~pyasn1.type.tagmap.TagMap` object mapping ASN.1 tags to ASN.1 objects contained within callee. )rrrJfgetrrrls r(rJz Choice.tagMapE s. ; 3:??4(( (%2 2r)Fc|jtjd|j|j}|r*t |t r||S|S)zReturn currently assigned component of the |ASN.1| object. Returns ------- : :py:class:`~pyasn1.type.base.PyAsn1Item` a PyASN1 object Nr)rrrr r6rrr%rcs r(rzChoice.getComponentO s_   ##$:;; ;%d&67A Z622 ~~i000r)c|jtjd|r<|j|j}t |t r||S|j|jS)zReturn the name of currently assigned component of the |ASN.1| object. Returns ------- : :py:class:`str` |ASN.1| component name Nr) rrrr r6rrrr}rs r(rzChoice.getName` su   ##$:;; ; 0)$*:;a((099Y///%778HII Ir)cX|jdS|j|j}|tuo|jS)a~Indicate that |ASN.1| object represents ASN.1 value. If *isValue* is :obj:`False` then this object represents just ASN.1 schema. If *isValue* is :obj:`True` then, in addition to its ASN.1 schema features, this object can also be used like a Python built-in object (e.g. :class:`int`, :class:`str`, :class:`dict` etc.). Returns ------- : :class:`bool` :obj:`False` if object represents just ASN.1 schema. :obj:`True` if object represents ASN.1 schema and can be used as a normal value. Note ---- There is an important distinction between PyASN1 schema and value objects. The PyASN1 schema objects can only participate in ASN.1 schema-related operations (e.g. defining or testing the structure of the data). Most obvious uses of ASN.1 schema is to guide serialisation codecs whilst encoding/decoding serialised ASN.1 contents. The PyASN1 value objects can **additionally** participate in many operations involving regular Python objects (e.g. arithmetic, comprehension etc). NF)rr rr5rbs r(r5zChoice.isValueq s58   #5.t/?@W,G1GGr)cDd|_t|Sr+)rrrRrls r(rRz Choice.clear syyr)c|jSr+) minTagSetrls r( getMinTagSetzChoice.getMinTagSet rr)r),rrrrr TagSetrrrrrrValueSizeConstraintrrrrrrrrrrrrrrnrrrrrr.rrrrrrJrrr5rRrrr)r(rrt sF++^SZ\\F)I(**M 5*4& &q!,,K ]]__FK      +++777EEE ===:::AAAYYY<<<FFF"3:t****1815)-04****X--X-33X3"JJJJ" H HX HD r)rceZdZdZejZejZ e Z e dZdS)raCreate |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type :class:`bytes`. When used in Unicode context, |ASN.1| type assumes "|encoding|" serialisation. Keyword Args ------------ value: :class:`unicode`, :class:`str`, :class:`bytes` or |ASN.1| object :class:`bytes`, alternatively :class:`str` representing character string to be serialised into octets (note `encoding` parameter) or |ASN.1| object. If `value` is not given, schema object will be created. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s). Constraints verification for |ASN.1| type occurs automatically on object instantiation. encoding: :py:class:`str` Unicode codec ID to encode/decode :class:`str` the payload when |ASN.1| object is used in text string context. binValue: :py:class:`str` Binary string initializer to use instead of the *value*. Example: '10110011'. hexValue: :py:class:`str` Hexadecimal string initializer to use instead of the *value*. Example: 'DEADBEEF'. Raises ------ ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error On constraint violation or bad initializer. Examples -------- .. code-block:: python class Error(Sequence): ''' ASN.1 specification: Error ::= SEQUENCE { code INTEGER, parameter ANY DEFINED BY code -- Either INTEGER or REAL } ''' componentType=NamedTypes( NamedType('code', Integer()), NamedType('parameter', Any(), openType=OpenType('code', {1: Integer(), 2: Real()})) ) error = Error() error['code'] = 1 error['parameter'] = Integer(1234) c |jS#t$rGtj|j|it jjt ji||_|jcYSwxYwr)_tagMapAttributeErrorr TagMaprr endOfOctetsrls r(rJz Any.tagMap si <    !=d#'9DL <    s AAAN)rrrrr rrrrrrrrrrJrr)r(rr sn@@HSZ\\F 5*466K " " $ $F   X   r)r)'rrpyasn1rpyasn1.codec.berr pyasn1.compatr pyasn1.typerrrr r r rr__all__r"r r rkrrrrrrrrr rrrrrrrrrr)r(rsh  !!!!!!""""""!!!!!!  , ')) ! ! !c c c c c d!c c c L=!=!=!=!=!g=!=!=!@     3   ]]]]]#]]]@ S%S%S%S%S%$%S%S%S%l11111;111hH1H1H1H1H1t*H1H1H1V~1~1~1~1~1$%~1~1~1BNNNNN4 NNNbB)B)B)B)B)B)B)B)NHHHHHT5HHHT00000'000.00000 "000.x 0x 0x 0x 0x 01x 0x 0x 0t     !   Fy3y3y3y3y3 y3y3y3xgggggSgggT ^ ^ ^ ^ ^ +^ ^ ^ ^ ^ r)