ó
    ÌÅLgõ¢  ã                   ó²  • S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	J
r
JrJrJrJrJrJr  SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJrJrJ r   SSKJ!r!J"r"J#r#J$r$  SSK%J&r&  SSK'J(r(  SS	K)J*r*  SS
K+J,r,  SSK-J.r.J/r/  SSK0J1r1  SSK2J3r3J4r4  SSK5J6r6  \S   r7\S   r8\	\Rr                  Rt                  \Rv                  Rx                  /S4   r=S\>S\4S jr?S\\\@4   S\>4S jrAS\\\>\B\@4   S\@4S jrCS\\*\&4   S\@4S jrD " S S5      rE " S S\E5      rF\F" \RŽ                  \R�                  \R’                  \R”                  1\RŽ                  \R�                  \R’                  1\R–                  \R˜                  \Rš                  1\R–                  15      rN\F" \O" 5       \O" 5       \O" 5       \O" 5       5      rP\NrQ   SaS\\R¤                  R¦                  \>4   S\R¨                  Rª                  S\\\>4   S \\R¤                  R¦                     S!\\E   S"\VS\,4S# jjrW SbS\\R¤                  R¦                  \>4   S\R¨                  Rª                  S\\\>4   S \\R¤                  R¦                     S\(4
S$ jjrXS%\
\R¤                  R¦                  \\R²                  R´                  \R¶                  R¸                  4   4   S&\3S\\\*      4S' jr]S(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S\\R¤                  R¦                  \R²                  R´                  4   4S) jr^S*\_S+\_S\*SS4S, jr`   ScS(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S&\3S%\
\R¤                  R¦                  \\R¶                  R¸                  \R²                  R´                  4   4   S \\R¤                  R¦                     S-\\B   S!\\E   SS4S. jjra   ScS(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S/\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S%\
\R¤                  R¦                  \\R¶                  R¸                  \R²                  R´                  4   4   S \\R¤                  R¦                     S-\\B   S!\\E   SS4S0 jjrb       SdS(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S2\8S3\R¤                  R¦                  S4\*S5\\\\>\@\B4      S6\\\\>\@\B4      S7\\@   S8\VS!\\E   S \\R¤                  R¦                     S9\VS\34S: jjrc SbS(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   S&\3S \\R¤                  R¦                     S\_4S; jjrd\6RÊ                  S<4S=\7S\\@\>4   S>\@S?\@S\*4
S@ jjrf\6RÊ                  S<4S=\7S\\@\>4   S>\@S?\@S\&4
SA jjrgSB\\R¤                  R¦                  \>4   SC\\\>\_4      SD\@S\\@\>4   S\>4
SE jrh SbS(\\Rv                  Rx                  \\R¤                  R¦                  \R²                  R´                  4   4   SF\\\\>4      S \\R¤                  R¦                     S\R²                  R´                  4SG jjriSH\R²                  R´                  S\R²                  R´                  4SI jrj SbS\\R¤                  R¦                  \>4   SH\R²                  R´                  S\\\>4   S \\R¤                  R¦                     S\R²                  R´                  4
SJ jjrkSH\R²                  R´                  S\R²                  R´                  4SK jrl      SeSL\Rr                  Rt                  S(\Rv                  Rx                  S3\R¤                  R¦                  SM\\\8\*4      SN\\\8\*4      S5\\\\>\@\B4      S6\\\\>\@\B4      S7\\@   S!\\E   S \\R¤                  R¦                     S9\VSS4SO jjrm           SfSP\RÜ                  RÞ                  SL\\Rr                  Rt                     S%\\\\8\*4         SQ\VSR\\@   S5\\\\>\@\B4      S6\\\\>\@\B4      S7\\@   SS\\1   ST\\=   S!\\E   S9\VSS4SU jjrp SbSP\RÜ                  RÞ                  SL\Rr                  Rt                  ST\\=   SS4SV jjrqSW rr\Ræ                  Ré                  SX5      (       aA  SSYKuJvrv  SSZKwJxrx  SS[KwJyry  SS\KwJzrz  SS]KwJ{r{  SS^KwJ|r|  SS_K}J~r~Jr  SS`K€J�r�J‚r‚  \brƒ\ar„\cr…\fr†\gr‡S1rˆO\rrƒ\rr„\rr…\rr†\rr‡Srˆ\RŽ                  rG\GR                  r‰\R�                  rH\GR                  rŠ\GR                  r‹\R’                  rI\GR                  rŒ\GR                  r�\GR                  rŽ\R”                  rJ\GR                  r�\GR                   r�\GR"                  r‘\GR$                  r’\GR&                  r“\GR(                  r”\GR*                  r•g)gz.Common DNSSEC-related functions and constants.é    N)Údatetime)ÚCallableÚDictÚListÚOptionalÚSetÚTupleÚUnionÚcast)Ú	AlgorithmÚDSDigestÚ	NSEC3Hash)ÚAlgorithmKeyMismatchÚDeniedByPolicyÚUnsupportedAlgorithmÚValidationFailure)ÚCDNSKEY)ÚCDS)ÚDNSKEY)ÚDS)ÚNSECÚBitmap)Ú
NSEC3PARAM)ÚRRSIGÚsigtime_to_posixtime)ÚFlag)ÚGenericPublicKeyzrsa.RSAPublicKeyzec.EllipticCurvePublicKeyzed25519.Ed25519PublicKeyzed448.Ed448PublicKey)ÚGenericPrivateKeyzrsa.RSAPrivateKeyzec.EllipticCurvePrivateKeyzed25519.Ed25519PrivateKeyzed448.Ed448PrivateKeyÚtextÚreturnc                 ó.   • [         R                  " U 5      $ )z…Convert text into a DNSSEC algorithm value.

*text*, a ``str``, the text to convert to into an algorithm value.

Returns an ``int``.
)r   Ú	from_text)r   s    Ú,/usr/lib/python3/dist-packages/dns/dnssec.pyÚalgorithm_from_textr$   L   s   € ô ×Ò˜tÓ$Ð$ó    Úvaluec                 ó.   • [         R                  " U 5      $ )zƒConvert a DNSSEC algorithm value to text

*value*, a ``dns.dnssec.Algorithm``.

Returns a ``str``, the name of a DNSSEC algorithm.
)r   Úto_text©r&   s    r#   Úalgorithm_to_textr*   W   s   € ô ×Ò˜UÓ#Ð#r%   c                 ó"  • [        U [        5      (       a  [        U R                  5       5      $ [        U [        5      (       a  [        U 5      $ [        U [        5      (       a  [        U 5      $ [        U [        5      (       a  U $ [        S5      e)z%Convert various format to a timestampzUnsupported timestamp type)Ú
isinstancer   ÚintÚ	timestampÚstrr   ÚfloatÚ	TypeErrorr)   s    r#   Úto_timestampr2   b   sn   € ä�%œ×"Ñ"Ü�5—?‘?Ó$Ó%Ð%Ü	�Eœ3×	Ñ	Ü# EÓ*Ð*Ü	�Eœ5×	!Ñ	!Ü�5‹zÐÜ	�Eœ3×	Ñ	ØˆäÐ4Ó5Ð5r%   Úkeyc                 ód  • U R                  5       nUc   eU R                  [        R                  :X  a  US   S-  US   -   $ Sn[	        [        U5      S-  5       H  nX!SU-     S-  USU-  S-      -   -  nM     [        U5      S-  S:w  a  X![        U5      S-
     S-  -  nX"S-	  S-  -  nUS-  $ )	z�Return the key id (a 16-bit number) for the specified key.

*key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY``

Returns an ``int`` between 0 and 65535
éýÿÿÿé   éþÿÿÿr   é   é   é   iÿÿ  )Úto_wireÚ	algorithmr   ÚRSAMD5ÚrangeÚlen)r3   ÚrdataÚtotalÚis       r#   Úkey_idrC   p   sÌ   € ð �K‰K‹M€EØÑÐÐØ
‡}�}œ	×(Ñ(Ó(Ø�b‘	˜Q‘ %¨¡)Ñ+Ð+àˆÜ”s˜5“z Q‘Ö'ˆAØ˜A ™E‘l aÑ'¨5°°Q±¸±Ñ+;Ñ;Ñ;ŠEñ (äˆu‹:˜‰>˜QÓØœ3˜u›:¨™>Ñ*¨aÑ/Ñ/ˆEØ˜2‘+ Ñ'Ñ'ˆØ�v‰~Ðr%   c                   ób   • \ rS rSrS rS\S\4S jrS\S\4S jrS\	S\4S jr
S\	S\4S jrS	rg
)ÚPolicyé†   c                 ó   • g ©N© )Úselfs    r#   Ú__init__ÚPolicy.__init__‡   s   € Ør%   Ú_r    c                 ó   • g©NFrI   ©rJ   rM   s     r#   Ú
ok_to_signÚPolicy.ok_to_signŠ   ó   € Ør%   c                 ó   • grO   rI   rP   s     r#   Úok_to_validateÚPolicy.ok_to_validate�   rS   r%   c                 ó   • grO   rI   rP   s     r#   Úok_to_create_dsÚPolicy.ok_to_create_ds�   rS   r%   c                 ó   • grO   rI   rP   s     r#   Úok_to_validate_dsÚPolicy.ok_to_validate_ds“   rS   r%   rI   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rK   r   ÚboolrQ   rU   r   rX   r[   Ú__static_attributes__rI   r%   r#   rE   rE   †   sS   † òð˜Fð  tô ð ð ¨4ô ð ð ¨dô ð 8ð °÷ r%   rE   c                   óp   ^ • \ rS rSrU 4S jrS\S\4S jrS\S\4S jrS\	S\4S jr
S\	S\4S	 jrS
rU =r$ )Ú
SimpleDenyé—   c                 óR   >• [         TU ]  5         Xl        X l        X0l        X@l        g rH   )ÚsuperrK   Ú
_deny_signÚ_deny_validateÚ_deny_create_dsÚ_deny_validate_ds)rJ   Ú	deny_signÚdeny_validateÚdeny_create_dsÚdeny_validate_dsÚ	__class__s        €r#   rK   ÚSimpleDeny.__init__˜   s%   ø€ Ü‰ÑÔØ#ŒØ+ÔØ-ÔØ!1Õr%   r3   r    c                 ó4   • UR                   U R                  ;  $ rH   )r<   rh   ©rJ   r3   s     r#   rQ   ÚSimpleDeny.ok_to_signŸ   s   € Ø�}‰} D§O¡OÑ3Ð3r%   c                 ó4   • UR                   U R                  ;  $ rH   )r<   ri   rs   s     r#   rU   ÚSimpleDeny.ok_to_validate¢   s   € Ø�}‰} D×$7Ñ$7Ñ7Ð7r%   r<   c                 ó   • XR                   ;  $ rH   )rj   ©rJ   r<   s     r#   rX   ÚSimpleDeny.ok_to_create_ds¥   s   € Ø× 4Ñ 4Ñ4Ð4r%   c                 ó   • XR                   ;  $ rH   )rk   rx   s     r#   r[   ÚSimpleDeny.ok_to_validate_ds¨   s   € Ø× 6Ñ 6Ñ6Ð6r%   )rj   rh   ri   rk   )r]   r^   r_   r`   rK   r   ra   rQ   rU   r   rX   r[   rb   Ú__classcell__)rp   s   @r#   rd   rd   —   sY   ø† õ2ð4˜fð 4¨ô 4ð8 &ð 8¨Tô 8ð5¨ð 5°dô 5ð7¨8ð 7¸÷ 7ò 7r%   rd   FÚnamer<   ÚoriginÚpolicyÚ
validatingc           	      óà  • Uc  [         n [        U[        5      (       a  [        UR	                  5          nU(       a  UR                  nOUR                  nU" U5      (       d  [        e[        U[        [        45      (       d  [        S5      eU[        R                  :X  a  [        R                  " 5       nOcU[        R                   :X  a  [        R"                  " 5       nO9U[        R$                  :X  a  [        R&                  " 5       nO[        SU S35      e[        U [        5      (       a  [(        R*                  R-                  X5      n U R/                  5       R1                  5       nUR1                  US9n	Ub  U	c   eUR3                  U5        UR3                  U	5        UR5                  5       n
[6        R8                  " S[;        U5      UR<                  U5      U
-   n[(        R>                  RA                  [(        RB                  RD                  [(        RF                  RH                  US[K        U5      5      n[M        [H        U5      $ ! [
         a    [        SU S35      ef = f)aO  Create a DS record for a DNSSEC key.

*name*, a ``dns.name.Name`` or ``str``, the owner name of the DS record.

*key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``,
the key the DS is about.

*algorithm*, a ``str`` or ``int`` specifying the hash algorithm.
The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case
does not matter for these strings.

*origin*, a ``dns.name.Name`` or ``None``.  If *key* is a relative name,
then it will be made absolute using the specified origin.

*policy*, a ``dns.dnssec.Policy`` or ``None``.  If ``None``, the default policy,
``dns.dnssec.default_policy`` is used; this policy defaults to that of RFC 8624.

*validating*, a ``bool``.  If ``True``, then policy is checked in
validating mode, i.e. "Is it ok to validate using this digest algorithm?".
Otherwise the policy is checked in creating mode, i.e. "Is it ok to create a DS with
this digest algorithm?".

Raises ``UnsupportedAlgorithm`` if the algorithm is unknown.

Raises ``DeniedByPolicy`` if the algorithm is denied by policy.

Returns a ``dns.rdtypes.ANY.DS.DS``
úunsupported algorithm "Ú"zkey is not a DNSKEY/CDNSKEY©r~   z!HBBr   )'Údefault_policyr,   r/   r   ÚupperÚ	Exceptionr   r[   rX   r   r   r   Ú
ValueErrorÚSHA1ÚhashlibÚsha1ÚSHA256Úsha256ÚSHA384Úsha384Údnsr}   r"   Úcanonicalizer;   ÚupdateÚdigestÚstructÚpackrC   r<   r@   Ú	from_wireÚ
rdataclassÚINÚ	rdatatyper   r?   r   )r}   r3   r<   r~   r   r€   ÚcheckÚdshashÚwireÚkwirer“   ÚdsrdataÚdss                r#   Úmake_dsr    ¹   sä  € ðJ �~ÜˆðKÜ�i¤×%Ñ%Ü  §¡Ó!2Ñ3ˆIö Ø×(Ñ(‰à×&Ñ&ˆÙ�×ÑÜÐÜ�cœF¤GÐ,×-Ñ-ÜÐ6Ó7Ð7Ø”H—M‘MÓ!Ü—’“‰Ø	”h—o‘oÓ	%Ü—’Ó!‰Ø	”h—o‘oÓ	%Ü—’Ó!‰ä"Ð%<¸Y¸KÀqÐ#IÓJÐJä�$œ×ÑÜ�x‰x×!Ñ! $Ó/ˆØ×ÑÓ×&Ñ&Ó(€DØ�K‰K˜vˆKÐ&€EØÑ Ñ 1Ð1Ð1Ø
‡M�M�$ÔØ
‡M�M�%ÔØ�]‰]‹_€Fä�kŠk˜&¤&¨£+¨s¯}©}¸iÓHÈ6ÑQ€GÜ	�‰×	Ñ	Ü�‰×Ñœ3Ÿ=™=×+Ñ+¨W°a¼¸W»ó
€Bô ”�B‹<ÐøôA ó KÜ"Ð%<¸Y¸KÀqÐ#IÓJÐJðKús   ‹,I ÉI-c           	      óÊ   • [        XX#5      n[        UR                  [        R                  R                  UR
                  UR                  UR                  UR                  S9$ )aq  Create a CDS record for a DNSSEC key.

*name*, a ``dns.name.Name`` or ``str``, the owner name of the DS record.

*key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``,
the key the DS is about.

*algorithm*, a ``str`` or ``int`` specifying the hash algorithm.
The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case
does not matter for these strings.

*origin*, a ``dns.name.Name`` or ``None``.  If *key* is a relative name,
then it will be made absolute using the specified origin.

Raises ``UnsupportedAlgorithm`` if the algorithm is unknown.

Returns a ``dns.rdtypes.ANY.DS.CDS``
©ÚrdclassÚrdtypeÚkey_tagr<   Údigest_typer“   )	r    r   r£   r�   r™   r¥   r<   r¦   r“   )r}   r3   r<   r~   rŸ   s        r#   Úmake_cdsr§     sM   € ô2 
�˜IÓ	.€BÜØ—
‘
Ü�}‰}× Ñ Ø—
‘
Ø—,‘,Ø—N‘NØ�y‰yñð r%   ÚkeysÚrrsigc                 ó\  • U R                  UR                  5      n[        U[        R                  R
                  5      (       aC  UR                  [        R                  R                  [        R                  R                  5      nOUnUc  g U Vs/ s H�  nUR                  UR                  :X  d  M  [        U5      UR                  :X  d  M:  UR                  [        R                   -  [        R                   :X  d  Mk  UR"                  S:X  d  M}  [%        [        U5      PM�     sn$ s  snf )Né   )ÚgetÚsignerr,   r�   ÚnodeÚNodeÚget_rdatasetr—   r˜   r™   r   r<   rC   r¥   Úflagsr   ÚZONEÚprotocolr   )r¨   r©   r&   ÚrdatasetÚrds        r#   Ú_find_candidate_keysr¶   *  sé   € ð �H‰H�U—\‘\Ó"€EÜ�%œŸ™Ÿ™×'Ñ'Ø×%Ñ%¤c§n¡n×&7Ñ&7¼¿¹×9MÑ9MÓN‰àˆØÑØñ óâˆBØ�<‰<˜5Ÿ?™?Ñ*ó 	ô �2‹J˜%Ÿ-™-Ñ'ó 	ð �X‰XœŸ	™	Ñ!¤d§i¡iÑ/ó	 	ð
 �K‰K˜1Ñó 	ŒŒV�RÖÙñð ùò s   ÂD)Â4D)Ã-D)Ä D)ÄD)Úrrsetc                 ó\   • [        U [        5      (       a
  U S   U S   4$ U R                  U 4$ )Nr   r9   )r,   Útupler}   )r·   s    r#   Ú_get_rrname_rdatasetrº   >  s3   € ô �%œ×ÑØ�Q‰x˜˜q™Ð!Ð!à�z‰z˜5Ð Ð r%   ÚsigÚdatac                 ó¦   • [        U5      R                  n UR                  U5      nUR                  X5        g ! [         a    [	        S5      ef = f)Nzinvalid public key)Úget_algorithm_cls_from_dnskeyÚ
public_clsÚfrom_dnskeyrˆ   r   Úverify)r»   r¼   r3   r¿   Ú
public_keys        r#   Ú_validate_signaturerÃ   G  sT   € ä.¨sÓ3×>Ñ>€Jð6Ø×+Ñ+¨CÓ0ˆ
ð ×Ñ�cÕ øô ó 6ÜÐ 4Ó5Ð5ð6ús	   —: ºAÚnowc                 ó®  • Uc  [         n[        X!5      nUc  [        S5      eUc  [        R                  " 5       nUR                  U:  a  [        S5      eUR
                  U:”  a  [        S5      e[        XU5      nU H2  nUR                  U5      (       d  M   [        UR                  Xx5          g   [        S5      e! [        [        4 a     MT  f = f)a~  Validate an RRset against a single signature rdata, throwing an
exception if validation is not successful.

*rrset*, the RRset to validate.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*rrsig*, a ``dns.rdata.Rdata``, the signature to validate.

*keys*, the key dictionary, used to find the DNSKEY associated
with a given name.  The dictionary is keyed by a
``dns.name.Name``, and has ``dns.node.Node`` or
``dns.rdataset.Rdataset`` values.

*origin*, a ``dns.name.Name`` or ``None``, the origin to use for relative
names.

*now*, a ``float`` or ``None``, the time, in seconds since the epoch, to
use as the current time when validating.  If ``None``, the actual current
time is used.

*policy*, a ``dns.dnssec.Policy`` or ``None``.  If ``None``, the default policy,
``dns.dnssec.default_policy`` is used; this policy defaults to that of RFC 8624.

Raises ``ValidationFailure`` if the signature is expired, not yet valid,
the public key is invalid, the algorithm is unknown, the verification
fails, etc.

Raises ``UnsupportedAlgorithm`` if the algorithm is recognized by
dnspython but not implemented.
Nzunknown keyÚexpiredznot yet validzverify failure)r…   r¶   r   ÚtimeÚ
expirationÚ	inceptionÚ_make_rrsig_signature_datarU   rÃ   Ú	signatureÚInvalidSignature)	r·   r©   r¨   r~   rÄ   r   Úcandidate_keysr¼   Úcandidate_keys	            r#   Ú_validate_rrsigrÏ   Q  sÔ   € ðP �~Üˆä)¨$Ó6€NØÑÜ Ó.Ð.à
�{Ü�iŠi‹kˆØ×Ñ˜#ÓÜ 	Ó*Ð*Ø‡�˜ÓÜ Ó0Ð0ä% e°FÓ;€Dó (ˆØ×$Ñ$ ]×3Ñ3Ùð	Ü §¡°ÔEÙñ (ô Ð,Ó
-Ð-øô	 !Ô"3Ð4ó 	âð	ús   ÂC Ã CÃCÚrrsigsetc           	      ón  • Uc  [         n[        U[        5      (       a8  [        R                  R                  U[        R                  R                  5      n[        U [        5      (       a  U S   nOU R                  n[        U[        5      (       a  US   nUS   nOUR                  nUnUR                  U5      nUR                  U5      nXg:w  a  [        S5      eU H1  n	[        U	[        5      (       d  [        S5      e [        X	X#XE5          g   [        S5      e! [        [        4 a     MS  f = f)aa  Validate an RRset against a signature RRset, throwing an exception
if none of the signatures validate.

*rrset*, the RRset to validate.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*rrsigset*, the signature RRset.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*keys*, the key dictionary, used to find the DNSKEY associated
with a given name.  The dictionary is keyed by a
``dns.name.Name``, and has ``dns.node.Node`` or
``dns.rdataset.Rdataset`` values.

*origin*, a ``dns.name.Name``, the origin to use for relative names;
defaults to None.

*now*, an ``int`` or ``None``, the time, in seconds since the epoch, to
use as the current time when validating.  If ``None``, the actual current
time is used.

*policy*, a ``dns.dnssec.Policy`` or ``None``.  If ``None``, the default policy,
``dns.dnssec.default_policy`` is used; this policy defaults to that of RFC 8624.

Raises ``ValidationFailure`` if the signature is expired, not yet valid,
the public key is invalid, the algorithm is unknown, the verification
fails, etc.
Nr   r9   zowner names do not matchzexpected an RRSIGzno RRSIGs validated)r…   r,   r/   r�   r}   r"   Úrootr¹   Úchoose_relativityr   r   rÏ   r   )
r·   rÐ   r¨   r~   rÄ   r   ÚrrnameÚ	rrsignameÚrrsigrdatasetr©   s
             r#   Ú	_validater×   —  s  € ðN �~Üˆä�&œ#×ÑÜ—‘×#Ñ# F¬C¯H©H¯M©MÓ:ˆä�%œ×ÑØ�q‘‰à—‘ˆä�(œE×"Ñ"Ø˜Q‘Kˆ	Ø  ™‰à—M‘Mˆ	Ø ˆà×%Ñ% fÓ-€FØ×+Ñ+¨FÓ3€IØÓÜÐ :Ó;Ð;ãˆÜ˜%¤×'Ñ'Ü#Ð$7Ó8Ð8ð	Ü˜E¨$¸ÔDÙñ ô Ð1Ó
2Ð2øô "Ô#7Ð8ó 	Úð	ús   ÄD Ä D4Ä3D4TÚprivate_keyr­   ÚdnskeyrÉ   rÈ   ÚlifetimerÁ   Údeterministicc                 óô  • Uc  [         nUR                  U5      (       d  [        e[        U [        5      (       a3  U S   R
                  nU S   R                  nU S   nU S   R                  nO0U R
                  nU R                  nU R                  nU R                  nUb  [        U5      nO[        [        R                  " 5       5      nUb  [        U5      nOUb  Xö-   nO[        S5      eU	b  UR                  U	5      n[        U5      S-
  nUR                  5       (       a  US-  n[!        U["        R$                  R                   UUR&                  UUUU[)        U5      USS9n["        R*                  R-                  U UU	5      n[        U[.        5      (       a  UnO [1        U5      nU" US9nUR7                  UXz5      n[9        [         UR;                  US95      $ ! [2         a    [5        S5      ef = f)	aÉ  Sign RRset using private key.

*rrset*, the RRset to validate.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*private_key*, the private key to use for signing, a
``cryptography.hazmat.primitives.asymmetric`` private key class applicable
for DNSSEC.

*signer*, a ``dns.name.Name``, the Signer's name.

*dnskey*, a ``DNSKEY`` matching ``private_key``.

*inception*, a ``datetime``, ``str``, ``int``, ``float`` or ``None``, the
signature inception time.  If ``None``, the current time is used.  If a ``str``, the
format is "YYYYMMDDHHMMSS" or alternatively the number of seconds since the UNIX
epoch in text form; this is the same the RRSIG rdata's text form.
Values of type `int` or `float` are interpreted as seconds since the UNIX epoch.

*expiration*, a ``datetime``, ``str``, ``int``, ``float`` or ``None``, the signature
expiration time.  If ``None``, the expiration time will be the inception time plus
the value of the *lifetime* parameter.  See the description of *inception* above
for how the various parameter types are interpreted.

*lifetime*, an ``int`` or ``None``, the signature lifetime in seconds.  This
parameter is only meaningful if *expiration* is ``None``.

*verify*, a ``bool``.  If set to ``True``, the signer will verify signatures
after they are created; the default is ``False``.

*policy*, a ``dns.dnssec.Policy`` or ``None``.  If ``None``, the default policy,
``dns.dnssec.default_policy`` is used; this policy defaults to that of RFC 8624.

*origin*, a ``dns.name.Name`` or ``None``.  If ``None``, the default, then all
names in the rrset (including its owner name) must be absolute; otherwise the
specified origin will be used to make names absolute when signing.

*deterministic*, a ``bool``. If ``True``, the default, use deterministic
(reproducible) signatures when supported by the algorithm used for signing.
Currently, this only affects ECDSA.

Raises ``DeniedByPolicy`` if the signature is denied by policy.
r9   r   z(expiration or lifetime must be specifiedr%   )r£   r¤   Útype_coveredr<   ÚlabelsÚoriginal_ttlrÈ   rÉ   r¥   r­   rË   ©r3   zUnsupported key algorithm)rË   )r…   rQ   r   r,   r¹   r£   r¤   Úttlr}   r2   r-   rÇ   rˆ   Úderelativizer?   Úis_wildr   r�   r™   r<   rC   ÚdnssecrÊ   r   r¾   r   r1   Úsignr   Úreplace)r·   rØ   r­   rÙ   rÉ   rÈ   rÚ   rÁ   r   r~   rÛ   r£   r¤   rÔ   rß   Úrrsig_inceptionÚrrsig_expirationrÞ   Úrrsig_templater¼   Úsigning_keyÚprivate_clsrË   s                          r#   Ú_signrì   à  så  € ðt �~ÜˆØ×Ñ˜V×$Ñ$ÜÐä�%œ×ÑØ˜‘(×"Ñ"ˆØ�q‘—‘ˆØ�q‘ˆØ˜Q‘x—|‘|‰à—-‘-ˆØ—‘ˆØ—‘ˆØ—y‘yˆàÑÜ& yÓ1‰äœdŸiši›kÓ*ˆàÑÜ'¨
Ó3ÑØ	Ñ	Ø*Ñ5ÑäÐCÓDÐDð ÑØ×$Ñ$ VÓ,ˆÜ�‹[˜1‰_€Fð ‡~�~×ÑØ�!‰ˆäØÜ�}‰}×"Ñ"ØØ×"Ñ"ØØ!Ø#Ø!Ü�v“ØØñ€Nô �:‰:×0Ñ0°¸ÈÓO€Dô �+Ô0×1Ñ1Ø!‰ð	9Ü7¸Ó?ˆKÙ%¨+Ñ6ˆKð × Ñ   vÓ=€Iä”�~×-Ñ-¸	Ð-ÐBÓCÐCøô $ó 	9ÜÐ7Ó8Ð8ð	9ús   Æ!G! Ç!G7c                 óÒ  • [        U[        5      (       a8  [        R                  R	                  U[        R                  R
                  5      nUR                  nUR                  5       (       d  Uc  [        S5      eUR                  U5      n[        U 5      u  pESnUR                  US9nUc   eXgSS -  nXaR                  R                  U5      -  nUR                  5       (       d  Uc  [        S5      eUR                  U5      n[        U5      nUR                  5       (       a  UR                  US-
  :w  a  [        S5      eUS-
  UR                  :  a  [        S	5      eUR                  US-
  :  aA  UR!                  UR                  S-   5      S   n	[        R                  R	                  S
U	5      nUR                  5       n
["        R$                  " SUR&                  UR(                  UR*                  5      nU Vs/ s H  oÌR                  U5      PM     nn[-        U5       H3  nXj-  nXk-  n["        R$                  " S[        U5      5      nXn-  nXl-  nM5     U$ s  snf )a¹  Create signature rdata.

*rrset*, the RRset to sign/validate.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*rrsig*, a ``dns.rdata.Rdata``, the signature to validate, or the
signature template used when signing.

*origin*, a ``dns.name.Name`` or ``None``, the origin to use for relative
names.

Raises ``UnsupportedAlgorithm`` if the algorithm is recognized by
dnspython but not implemented.
Nz,relative RR name without an origin specifiedr%   r„   é   r8   z&wild owner name has wrong label lengthr9   z#owner name longer than RRSIG labelsÚ*z!HHIz!H)r,   r/   r�   r}   r"   rÒ   r­   Úis_absoluter   râ   rº   r;   Úto_digestabler?   rã   rÞ   Úsplitr”   r•   r¤   r£   rß   Úsorted)r·   r©   r~   r­   rÔ   r´   r¼   rœ   Úname_lenÚsuffixÚ	rrnamebufÚrrfixedr@   ÚrdatasÚrrlens                  r#   rÊ   rÊ   _  s  € ô* �&œ#×ÑÜ—‘×#Ñ# F¬C¯H©H¯M©MÓ:ˆà�\‰\€FØ×Ñ×ÑØ‰>Ü#Ð$RÓSÐSØ×$Ñ$ VÓ,ˆô ,¨EÓ2Ñ€Fà€DØ�=‰= ˆ=Ð'€DØÑÐÐØ��"ˆIÑ€DØ�L‰L×&Ñ& vÓ.Ñ.€Dð ×Ñ×ÑØ‰>Ü#Ð$RÓSÐSØ×$Ñ$ VÓ,ˆä�6‹{€HØ‡~�~×Ñ˜EŸL™L¨H°q©LÓ8ÜÐ HÓIÐIØ�!�|�e—l‘lÓ"ÜÐ EÓFÐFØ	�‰˜ 1™Ó	$Ø—‘˜eŸl™l¨QÑ.Ó/°Ñ2ˆÜ—‘×#Ñ# C¨Ó0ˆØ×$Ñ$Ó&€IÜ�kŠk˜& (§/¡/°8×3CÑ3CÀU×EWÑEWÓX€GÙ7?Ó@²x¨e×!Ñ! &Ö)±x€FÐ@Ü˜–ˆØÑˆØ‰ˆÜ—’˜D¤# e£*Ó-ˆØ‰ˆØ‰Šñ  ð €Kùò As   ÈI$r«   rÂ   r±   r³   c                 óÆ   • [         R                  " U5      n[        U [        5      (       a  U R	                  X#S9$ [        U5      R                  nU" U S9R	                  X#S9$ )aT  Convert a public key to DNSKEY Rdata

*public_key*, a ``PublicKey`` (``GenericPublicKey`` or
``cryptography.hazmat.primitives.asymmetric``) to convert.

*algorithm*, a ``str`` or ``int`` specifying the DNSKEY algorithm.

*flags*: DNSKEY flags field as an integer.

*protocol*: DNSKEY protocol field as an integer.

Raises ``ValueError`` if the specified key algorithm parameters are not
unsupported, ``TypeError`` if the key type is unsupported,
`UnsupportedAlgorithm` if the algorithm is unknown and
`AlgorithmKeyMismatch` if the algorithm does not match the key type.

Return DNSKEY ``Rdata``.
)r±   r³   rà   )r   Úmaker,   r   Ú	to_dnskeyÚget_algorithm_clsr¿   )rÂ   r<   r±   r³   r¿   s        r#   Ú_make_dnskeyrþ   ¢  s_   € ô2 —’˜yÓ)€Iô �*Ô.×/Ñ/Ø×#Ñ#¨%Ð#ÐCÐCä& yÓ1×<Ñ<ˆ
Ù˜jÑ)×3Ñ3¸%Ð3ÐSÐSr%   c           	      óÊ   • [        XX#5      n[        UR                  [        R                  R                  UR
                  UR                  UR                  UR                  S9$ )ae  Convert a public key to CDNSKEY Rdata

*public_key*, the public key to convert, a
``cryptography.hazmat.primitives.asymmetric`` public key class applicable
for DNSSEC.

*algorithm*, a ``str`` or ``int`` specifying the DNSKEY algorithm.

*flags*: DNSKEY flags field as an integer.

*protocol*: DNSKEY protocol field as an integer.

Raises ``ValueError`` if the specified key algorithm parameters are not
unsupported, ``TypeError`` if the key type is unsupported,
`UnsupportedAlgorithm` if the algorithm is unknown and
`AlgorithmKeyMismatch` if the algorithm does not match the key type.

Return CDNSKEY ``Rdata``.
©r£   r¤   r±   r³   r<   r3   )	rþ   r   r£   r�   r™   r±   r³   r<   r3   )rÂ   r<   r±   r³   rÙ   s        r#   Ú_make_cdnskeyr  Å  sO   € ô4 ˜*°ÓA€FäØ—‘Ü�}‰}×$Ñ$Ø�l‰lØ—‘Ø×"Ñ"Ø�J‰Jñð r%   ÚdomainÚsaltÚ
iterationsc                 óš  • [         R                  SS5      n [        U[         5      (       a  [        UR	                  5          nU[        R                  :w  a  [        S5      eUc  SnOJ[        U[         5      (       a3  [        U5      S-  S:X  a  [        R                  U5      nO[        S5      eUn[        U [        R                  R                  5      (       d  [        R                  R                  U 5      n U R                  5       R!                  5       nUc   e["        R$                  " Xe-   5      R'                  5       n[)        U5       H)  n["        R$                  " Xu-   5      R'                  5       nM+     [*        R,                  " U5      R/                  S5      n	U	R1                  U5      n	U	$ ! [
         a    [        S5      ef = f)	a¸  
Calculate the NSEC3 hash, according to
https://tools.ietf.org/html/rfc5155#section-5

*domain*, a ``dns.name.Name`` or ``str``, the name to hash.

*salt*, a ``str``, ``bytes``, or ``None``, the hash salt.  If a
string, it is decoded as a hex string.

*iterations*, an ``int``, the number of iterations.

*algorithm*, a ``str`` or ``int``, the hash algorithm.
The only defined algorithm is SHA1.

Returns a ``str``, the encoded NSEC3 hash.
Ú ABCDEFGHIJKLMNOPQRSTUVWXYZ234567Ú 0123456789ABCDEFGHIJKLMNOPQRSTUVz-Wrong hash algorithm (only SHA1 is supported)r%   r8   r   zInvalid salt lengthzutf-8)r/   Ú	maketransr,   r   r†   r‡   rˆ   r‰   r?   ÚbytesÚfromhexr�   r}   ÚNamer"   r‘   r;   rŠ   r‹   r“   r>   Úbase64Ú	b32encodeÚdecodeÚ	translate)
r  r  r  r<   Úb32_conversionÚsalt_encodedÚdomain_encodedr“   rM   Úoutputs
             r#   Ú
nsec3_hashr  ë  s|  € ô. —]‘]Ø*Ð,Nó€NðJÜ�i¤×%Ñ%Ü! )§/¡/Ó"3Ñ4ˆIð ”I—N‘NÓ"ÜÐHÓIÐIà�|Ø‰Ü	�Dœ#×	Ñ	Üˆt‹9�q‰=˜AÓÜ Ÿ=™=¨Ó.‰LäÐ2Ó3Ð3àˆä�fœcŸh™hŸm™m×,Ñ,Ü—‘×#Ñ# FÓ+ˆØ×(Ñ(Ó*×2Ñ2Ó4€NØÑ%Ð%Ð%ä�\Š\˜.Ñ7Ó8×?Ñ?ÓA€FÜ�:ÖˆÜ—’˜fÑ3Ó4×;Ñ;Ó=Šñ ô ×Ò˜fÓ%×,Ñ,¨WÓ5€FØ×Ñ˜nÓ-€Fà€Møô9 ó JÜÐHÓIÐIðJús   ˜,F4 Æ4G
Ú
algorithmsc           	      óª  • [        U 5      u  p4UR                  [        R                  R                  [        R                  R
                  [        R                  R                  4;  a  [        S5      e[        5       nU HA  n [        U[        5      (       a  [        UR                  5          nUR                  U5        MC     UR                  [        R                  R                  :X  a{  / n[!        U5       H&  nUR"                  U;   d  M  UR%                  U5        M(     ['        U5      S:X  a  [        S5      e[        R(                  R+                  UR,                  U5      $ / nU H  nUR/                  [1        X4Xb5      5        M      [        R(                  R+                  UR,                  U5      $ ! [         a    [        SU S35      ef = f)aã  Create a DS record from DNSKEY/CDNSKEY/CDS.

*rrset*, the RRset to create DS Rdataset for.  This can be a
``dns.rrset.RRset`` or a (``dns.name.Name``, ``dns.rdataset.Rdataset``)
tuple.

*algorithms*, a set of ``str`` or ``int`` specifying the hash algorithms.
The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case
does not matter for these strings. If the RRset is a CDS, only digest
algorithms matching algorithms are accepted.

*origin*, a ``dns.name.Name`` or ``None``.  If `key` is a relative name,
then it will be made absolute using the specified origin.

Raises ``UnsupportedAlgorithm`` if any of the algorithms are unknown and
``ValueError`` if the given RRset is not usable.

Returns a ``dns.rdataset.Rdataset``
zrrset not a DNSKEY/CDNSKEY/CDSr‚   rƒ   r   zno acceptable CDS rdata found)rº   r¤   r�   r™   r   r   r   rˆ   Úsetr,   r/   r   r†   r‡   r   ÚaddÚcds_rdataset_to_ds_rdatasetr¦   Úappendr?   r´   Úfrom_rdata_listrá   ÚextendÚdnskey_rdataset_to_cds_rdataset)	r·   r  r~   rÔ   r´   Ú_algorithmsr<   Úresr@   s	            r#   Úmake_ds_rdatasetr   (  sz  € ô2 ,¨EÓ2Ñ€Fà‡�Ü�‰×ÑÜ�‰×ÑÜ�‰×Ñðó ô
 Ð9Ó:Ð:ä“%€KÛˆ	ð	OÜ˜)¤S×)Ñ)Ü$ Y§_¡_Ó%6Ñ7�	ð 	�‰˜	Ö"ñ  ð ‡�œ#Ÿ-™-×+Ñ+Ó+ØˆÜ0°Ö:ˆEØ× Ñ  KÕ/Ø—
‘
˜5Ö!ñ ;ô ˆs‹8�q‹=ÜÐ<Ó=Ð=Ü�|‰|×+Ñ+¨H¯L©L¸#Ó>Ð>à
€CÛ ˆ	Ø�
‰
Ô2°6ÀYÓWÖXñ !ä�<‰<×'Ñ'¨¯©°cÓ:Ð:øô! ó 	OÜ&Ð)@ÀÀÈ1Ð'MÓNÐNð	Oús   Â,F8Æ8Gr´   c                 ó   • U R                   [        R                  R                  :w  a  [	        S5      e/ nU  Hj  nUR                  [        UR                  [        R                  R                  UR                  UR                  UR                  UR                  S95        Ml     [        R                  R                  U R                  U5      $ )zºCreate a CDS record from DS.

*rdataset*, a ``dns.rdataset.Rdataset``, to create DS Rdataset for.

Raises ``ValueError`` if the rdataset is not CDS.

Returns a ``dns.rdataset.Rdataset``
zrdataset not a CDSr¢   )r¤   r�   r™   r   rˆ   r  r£   r   r¥   r<   r¦   r“   r´   r  rá   ©r´   r  r@   s      r#   r  r  b  s˜   € ð ‡�œ#Ÿ-™-×+Ñ+Ó+ÜÐ-Ó.Ð.Ø
€CÛˆØ�
‰
ÜØŸ™Ü—}‘}×'Ñ'ØŸ™ØŸ/™/Ø!×-Ñ-Ø—|‘|ñö		
ñ ô �<‰<×'Ñ'¨¯©°cÓ:Ð:r%   c           	      ó<  • UR                   [        R                  R                  [        R                  R                  4;  a  [        S5      e/ nU H  nUR                  [        XX#5      5        M      [        R                  R                  UR                  U5      $ )a…  Create a CDS record from DNSKEY/CDNSKEY.

*name*, a ``dns.name.Name`` or ``str``, the owner name of the CDS record.

*rdataset*, a ``dns.rdataset.Rdataset``, to create DS Rdataset for.

*algorithm*, a ``str`` or ``int`` specifying the hash algorithm.
The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case
does not matter for these strings.

*origin*, a ``dns.name.Name`` or ``None``.  If `key` is a relative name,
then it will be made absolute using the specified origin.

Raises ``UnsupportedAlgorithm`` if the algorithm is unknown or
``ValueError`` if the rdataset is not DNSKEY/CDNSKEY.

Returns a ``dns.rdataset.Rdataset``
zrdataset not a DNSKEY/CDNSKEY)r¤   r�   r™   r   r   rˆ   r  r§   r´   r  rá   )r}   r´   r<   r~   r  r@   s         r#   r  r    sr   € ð2 ‡�œsŸ}™}×3Ñ3´S·]±]×5JÑ5JÐKÓKÜÐ8Ó9Ð9Ø
€CÛˆØ�
‰
”8˜D¨Ó;Ö<ñ ä�<‰<×'Ñ'¨¯©°cÓ:Ð:r%   c                 ó„  • U R                   [        R                  R                  :w  a  [	        S5      e/ nU  H\  nUR                  [        U R                  U R                   UR                  UR                  UR                  UR                  S95        M^     [        R                  R                  U R                  U5      $ )z”Create a CDNSKEY record from DNSKEY.

*rdataset*, a ``dns.rdataset.Rdataset``, to create CDNSKEY Rdataset for.

Returns a ``dns.rdataset.Rdataset``
zrdataset not a DNSKEYr   )r¤   r�   r™   r   rˆ   r  r   r£   r±   r³   r<   r3   r´   r  rá   r"  s      r#   Ú#dnskey_rdataset_to_cdnskey_rdatasetr%     s’   € ð ‡�œ#Ÿ-™-×.Ñ.Ó.ÜÐ0Ó1Ð1Ø
€CÛˆØ�
‰
ÜØ ×(Ñ(Ø—‘Ø—k‘kØŸ™ØŸ/™/Ø—I‘Iñö		
ñ ô �<‰<×'Ñ'¨¯©°cÓ:Ð:r%   ÚtxnÚksksÚzsksc                 óÂ  • UR                   [        [        R                  R                  R
                  [        R                  R                  R                  [        R                  R                  R                  /5      ;   a  UnOUnU HR  u  pÍ[        R                  R                  UUUUUUUUU	U
S9
nU R                  UR                  UR                  U5        MT     g)zDefault RRset signer)
r·   rØ   rÙ   rÉ   rÈ   rÚ   r­   r   r~   rÛ   N)r¤   r  r�   r™   Ú	RdataTyper   r   r   rä   rå   r  r}   rá   )r&  r·   r­   r'  r(  rÉ   rÈ   rÚ   r   r~   rÛ   r¨   rØ   rÙ   r©   s                  r#   Údefault_rrset_signerr+  »  s½   € ð ‡|�|”sä�M‰M×#Ñ#×*Ñ*Ü�M‰M×#Ñ#×'Ñ'Ü�M‰M×#Ñ#×+Ñ+ð	
óó ð ‰àˆã#ÑˆÜ—
‘
—‘ØØ#ØØØ!ØØØØØ'ð  ð 
ˆð 	�‰�—
‘
˜EŸI™I uÖ-ò  $r%   ÚzoneÚ
add_dnskeyÚ
dnskey_ttlÚnsec3Úrrset_signerc                 óÜ  • / n/ nU(       ae  U HL  nUS   R                   [        R                  -  (       a  UR                  U5        M;  UR                  U5        MN     U(       d  UnU(       d  UnO/ nU(       a  [        R
                  " U5      nOU R                  5       nU R                  c  [        S5      eU nU(       a´  Ucˆ  UR                  U R                  [        R                  R                  5      nU(       a  UR                  nO@UR                  U R                  [        R                  R                  5      nUR                  nU H#  u  nnUR                  U R                  UU5        M%     U(       a  [!        S5      eU	=(       d5    ["        R$                  " [&        U R                  UUUUUU
U R                  US9
n[)        U UU5      sSSS5        $ ! , (       d  f       g= f)a‰  Sign zone.

*zone*, a ``dns.zone.Zone``, the zone to sign.

*txn*, a ``dns.transaction.Transaction``, an optional transaction to use for
signing.

*keys*, a list of (``PrivateKey``, ``DNSKEY``) tuples, to use for signing. KSK/ZSK
roles are assigned automatically if the SEP flag is used, otherwise all RRsets are
signed by all keys.

*add_dnskey*, a ``bool``.  If ``True``, the default, all specified DNSKEYs are
automatically added to the zone on signing.

*dnskey_ttl*, a``int``, specifies the TTL for DNSKEY RRs. If not specified the TTL
of the existing DNSKEY RRset used or the TTL of the SOA RRset.

*inception*, a ``datetime``, ``str``, ``int``, ``float`` or ``None``, the signature
inception time.  If ``None``, the current time is used.  If a ``str``, the format is
"YYYYMMDDHHMMSS" or alternatively the number of seconds since the UNIX epoch in text
form; this is the same the RRSIG rdata's text form. Values of type `int` or `float`
are interpreted as seconds since the UNIX epoch.

*expiration*, a ``datetime``, ``str``, ``int``, ``float`` or ``None``, the signature
expiration time.  If ``None``, the expiration time will be the inception time plus
the value of the *lifetime* parameter.  See the description of *inception* above for
how the various parameter types are interpreted.

*lifetime*, an ``int`` or ``None``, the signature lifetime in seconds.  This
parameter is only meaningful if *expiration* is ``None``.

*nsec3*, a ``NSEC3PARAM`` Rdata, configures signing using NSEC3. Not yet
implemented.

*rrset_signer*, a ``Callable``, an optional function for signing RRsets. The
function requires two arguments: transaction and RRset. If the not specified,
``dns.dnssec.default_rrset_signer`` will be used.

*deterministic*, a ``bool``. If ``True``, the default, use deterministic
(reproducible) signatures when supported by the algorithm used for signing.
Currently, this only affects ECDSA.

Returns ``None``.
r9   Nzno zone originz&Signing with NSEC3 not yet implemented)	r­   r'  r(  rÉ   rÈ   rÚ   r   r~   rÛ   )r±   r   ÚSEPr  Ú
contextlibÚnullcontextÚwriterr~   rˆ   r¬   r�   r™   r   rá   ÚSOAr  ÚNotImplementedErrorÚ	functoolsÚpartialr+  Ú_sign_zone_nsec)r,  r&  r¨   r-  r.  rÉ   rÈ   rÚ   r/  r0  r   rÛ   r'  r(  r3   ÚcmÚ_txnrÙ   ÚsoarM   Ú_rrset_signers                        r#   Ú	sign_zoner?  å  s}  € ðv €DØ€Dö ÛˆCØ�1‰v�|‰|œdŸh™h×&Ø—‘˜CÖ à—‘˜CÖ ñ	 ö
 ØˆDÞØˆDøàˆæ
Ü0:×0FÒ0FÀsÓ0K‰à�[‰[‹]ˆà‡{�{ÑÜÐ)Ó*Ð*á	ˆtÞØÑ!ØŸ™ $§+¡+¬s¯}©}×/CÑ/CÓD�ÞØ!'§¡‘JàŸ(™( 4§;¡;´·±×0AÑ0AÓB�CØ!$§¡�JÛ!‘	��6Ø—‘˜Ÿ™ j°&Ö9ñ "ö Ü%Ð&NÓOÐOà(÷ ¬I×,=Ò,=Ü$Ø—{‘{ØØØ#Ø%Ø!ØØ—{‘{Ø+ñ-ˆMô # 4¨¨}Ó=÷7 
��ús   Â;DGÇ
G+c                 ó`  •  S
S[         R                  R                  S[         R                  R                  S[
        [         R                  R                     S[         R                  R                  S[        S[
        [           SS4S	 jjnU R                  5       R                  nSnSn[        UR                  5       5       GH?  nU(       a  UR                  U5      (       a  M#  UR                  U[         R                   R"                  5      (       a  XpR$                  :w  a  UnOSnU(       a¹  UR'                  U5      nU(       a¡  UR(                   H‘  n	U	R*                  [         R                   R,                  :X  a  M-  U(       a*  U	R*                  [         R                   R.                  :w  a  M^  [         R0                  R2                  " XyR4                  /U	Q76 n
U" X5        M“     Ub  U" XXpR6                  XB5        UnGMB     U(       a   U" XU R$                  U R6                  XB5        gg)zNSEC zone signerNr&  r}   Únext_securer£   rá   r0  r    c                 óp  • [        [        R                  R                  R                  [        R                  R                  R
                  /5      nU R                  U5      nU(       aÈ  U(       aÀ  [        UR                   Vs/ s H  oˆR                  PM     sn5      U-  n	[        R                  " [        U	5      5      n
[        R                  R                  UU[        U[        R                  R                  R
                  UU
S95      nU R                  U5        U(       a	  U" X5        ggggs  snf )zNSEC zone signer helper)r£   r¤   ÚnextÚwindowsN)r  r�   r™   r*  r   r   Úget_nodeÚ	rdatasetsr¤   r   Úfrom_rdtypesÚlistr·   Ú
from_rdatar  )r&  r}   rA  r£   rá   r0  Úmandatory_typesr®   r´   ÚtypesrD  r·   s               r#   Ú_txn_add_nsecÚ&_sign_zone_nsec.<locals>._txn_add_nsec_  sí   € ô Ü�]‰]×$Ñ$×*Ñ*¬C¯M©M×,CÑ,C×,HÑ,HÐIó
ˆð �|‰|˜DÓ!ˆÞ–Kä°T·^²^ÓD²^¨—_”_±^ÑDÓEÈÑWð ô ×)Ò)¬$¨u«+Ó6ˆGÜ—I‘I×(Ñ(ØØÜØ#ÜŸ=™=×2Ñ2×7Ñ7Ø$Ø#ñ	ó	ˆEð �G‰G�EŒNÞÙ˜SÕ(ð ð!  ˆ4ùâDs   ÂD3rH   )r�   ÚtransactionÚTransactionr}   r  r   r—   Ú
RdataClassr-   ÚRRsetSignerÚget_soaÚminimumró   Úiterate_namesÚis_subdomainr¬   r™   ÚNSr~   rE  rF  r¤   r   r   r·   rI  rá   r£   )r,  r&  r0  rL  Ú	rrsig_ttlÚ
delegationÚlast_securer}   r®   r´   r·   s              r#   r:  r:  X  s³  € ð /3ñ)Ü�_‰_×(Ñ(ð)ä�h‰h�m‰mð)ô œcŸh™hŸm™mÑ,ð)ô —‘×*Ñ*ð	)ô
 ð)ô œ{Ñ+ð)ð 
õ)ð@ —‘“×&Ñ&€IØ€JØ€Kä�s×(Ñ(Ó*×+ˆÞ˜$×+Ñ+¨J×7Ñ7áØ�W‰W�Tœ3Ÿ=™=×+Ñ+×,Ñ,°¿¹Ó1Dà‰Jð ˆJæØ—<‘< Ó%ˆDÞØ $§¤�HØ—‘¬#¯-©-×*=Ñ*=Ó=á Þ#¨¯©¼3¿=¹=×;KÑ;KÓ(Ká ä #§	¡	× 4Ò 4°T¿<¹<Ð SÈ(Ò S˜Ù$ SÖ0ñ !/ð Ñ"Ù˜#¨D·,±,À	ÔXØ‹ñ9 ,ö< ÙØ˜dŸk™k¨4¯<©<¸õ	
ð r%   c                  ó   • [        S5      e)Nz.DNSSEC validation requires python cryptography)ÚImportError)ÚargsÚkwargss     r#   Ú
_need_pycar^  §  s   € Ü
Ø8óð r%   rä   )rÌ   )Údsa)Úec)Úed448)Úrsa)Úed25519)rý   r¾   )r   r   )NNFrH   )NNN)NNNFNNT)NNNNNT)NNTNNNNNNNT)–Ú__doc__r  r3  r8  rŠ   r”   rÇ   r   Útypingr   r   r   r   r   r	   r
   r   Údns._featuresr�   Údns.exceptionÚdns.nameÚdns.nodeÚ	dns.rdataÚdns.rdataclassÚdns.rdatasetÚdns.rdatatypeÚ	dns.rrsetÚdns.transactionÚdns.zoneÚdns.dnssectypesr   r   r   r   r   r   r   Údns.rdtypes.ANY.CDNSKEYr   Údns.rdtypes.ANY.CDSr   Údns.rdtypes.ANY.DNSKEYr   Údns.rdtypes.ANY.DSr   Údns.rdtypes.ANY.NSECr   r   Údns.rdtypes.ANY.NSEC3PARAMr   Údns.rdtypes.ANY.RRSIGr   r   Údns.rdtypes.dnskeybaser   Ú	PublicKeyÚ
PrivateKeyrN  rO  r·   ÚRRsetrQ  r/   r$   r-   r*   r0   r2   rC   rE   rd   r=   ÚDSAÚDSANSEC3SHA1ÚECCGOSTÚNULLr‰   ÚGOSTÚrfc_8624_policyr  Úallow_all_policyr…   r}   r  r@   ÚRdatara   r    r§   r´   ÚRdatasetr®   r¯   r¶   rº   r	  rÃ   rÏ   r×   rì   rÊ   r²   rþ   r  r  r   r  r  r%  r+  r,  ÚZoner?  r:  r^  Ú	_featuresÚhaveÚcryptography.exceptionsrÌ   Ú)cryptography.hazmat.primitives.asymmetricr_  r`  ra  rb  rc  Údns.dnssecalgsrý   r¾   Údns.dnssecalgs.baser   r   ÚvalidateÚvalidate_rrsigrå   Úmake_dnskeyÚmake_cdnskeyÚ
_have_pycaÚDHÚECCÚRSASHA1ÚRSASHA1NSEC3SHA1Ú	RSASHA256Ú	RSASHA512ÚECDSAP256SHA256ÚECDSAP384SHA384ÚED25519ÚED448ÚINDIRECTÚ
PRIVATEDNSÚ
PRIVATEOIDrI   r%   r#   Ú<module>rŸ     s¿  ðñ$ 5ó Û Û Û Û Û Ý ß J× JÓ Jã Û Û Û Û Û Û Û Û Û Û ß :Ñ :÷ó õ ,Ý #Ý )Ý !ß -Ý 1ß =Ý 'àðñ€	ð ðñ€
ð ˜Ÿ™×3Ñ3°S·Y±Y·_±_ÐEÀtÐKÑL€ð%˜cð % iô %ð$˜U 9¨c >Ñ2ð $°sô $ð6˜˜h¨¨U°CÐ7Ñ8ð 6¸Sô 6ð��f˜g�oÑ&ð ¨3ô ÷,ñ ô"7�ô 7ñ* Ø×Ñ�y—}‘} i×&<Ñ&<¸i×>OÑ>OÐPØ×Ñ�y—}‘} i×&<Ñ&<Ð=Ø‡]�]�H—M‘M 8§=¡=Ð1Ø‡]�]€Oó	€ñ ™c›e¡S£U©C«E±3³5Ó9Ð ð !€ð '+Ø#ØñJØ
�—‘—‘˜sÐ"Ñ
#ðJà	�‰�‰ðJð �X˜s�]Ñ#ðJð �S—X‘X—]‘]Ñ#ð	Jð
 �VÑðJð ðJð õJðb '+ñ	!Ø
�—‘—‘˜sÐ"Ñ
#ð!à	�‰�‰ð!ð �X˜s�]Ñ#ð!ð �S—X‘X—]‘]Ñ#ð	!ð
 	õ!ðHØ
ˆs�x‰x�}‰}˜e C§L¡L×$9Ñ$9¸3¿8¹8¿=¹=Ð$HÑIÐIÑ
JðØSXðàˆd�6‰lÑôð(!Ø�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNð!à
ˆ3�8‰8�=‰=˜#Ÿ,™,×/Ñ/Ð/Ñ0ô!ð!˜Uð !¨%ð !°fð !Àô !ð '+ØØ#ñC.Ø�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNðC.àðC.ð ˆs�x‰x�}‰}˜e C§H¡H§M¡M°3·<±<×3HÑ3HÐ$HÑIÐIÑ
JðC.ð �S—X‘X—]‘]Ñ#ð	C.ð
 
�%‰ðC.ð �VÑðC.ð 
õC.ðT '+ØØ#ñF3Ø�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNðF3à�C—I‘I—O‘O U¨3¯8©8¯=©=¸#¿,¹,×:OÑ:OÐ+OÑ%PÐPÑQðF3ð ˆs�x‰x�}‰}˜e C§H¡H§M¡M°3·<±<×3HÑ3HÐ$HÑIÐIÑ
JðF3ð �S—X‘X—]‘]Ñ#ð	F3ð
 
�%‰ðF3ð �VÑðF3ð 
õF3ð\ =AØ=AØ"ØØ#Ø&*Øñ|DØ�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNð|Dàð|Dð �H‰H�M‰Mð|Dð ð	|Dð
 ˜˜h¨¨S°%Ð7Ñ8Ñ9ð|Dð ˜˜x¨¨c°5Ð8Ñ9Ñ:ð|Dð �s‰mð|Dð ð|Dð �VÑð|Dð �S—X‘X—]‘]Ñ#ð|Dð ð|Dð õ|DðD '+ñ@Ø�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNð@àð@ð �S—X‘X—]‘]Ñ#ð@ð õ	@ðL —‘Øñ	 TØð Tà�S˜#�X‰ð Tð ð Tð ð	 Tð
 õ TðL —‘Øñ	#Øð#à�S˜#�X‰ð#ð ð#ð ð	#ð
 õ#ðL:Ø�#—(‘(—-‘- Ð$Ñ%ð:à
�5˜˜e˜Ñ$Ñ
%ð:ð ð:ð �S˜#�X‰ð	:ð
 	ô:ð@ '+ñ7;Ø�—‘—‘ %¨¯©¯©°s·|±|×7LÑ7LÐ(LÑ"MÐMÑNð7;à�E˜( C˜-Ñ(Ñ)ð7;ð �S—X‘X—]‘]Ñ#ð7;ð 	‡\�\×Ñõ	7;ðt;Ø�l‰l×#Ñ#ð;à‡\�\×Ñô;ðB '+ñ	;Ø
�—‘—‘˜sÐ"Ñ
#ð;à�l‰l×#Ñ#ð;ð �X˜s�]Ñ#ð;ð �S—X‘X—]‘]Ñ#ð	;ð
 	‡\�\×Ñõ;ðB;Ø�l‰l×#Ñ#ð;à‡\�\×Ñô;ðB =AØ=AØ"Ø#Ø&*Øñ'.Ø	�‰×	$Ñ	$ð'.à�9‰9�?‰?ð'.ð �H‰H�M‰Mð'.ð ˆu�Z Ð'Ñ(Ñ
)ð	'.ð
 ˆu�Z Ð'Ñ(Ñ
)ð'.ð ˜˜h¨¨S°%Ð7Ñ8Ñ9ð'.ð ˜˜x¨¨c°5Ð8Ñ9Ñ:ð'.ð �s‰mð'.ð �VÑð'.ð �S—X‘X—]‘]Ñ#ð'.ð ð'.ð 
õ'.ðX 26Ø6:ØØ $Ø<@Ø=AØ"Ø"&Ø*.Ø#Øñp>Ø
�(‰(�-‰-ðp>à	�#—/‘/×-Ñ-Ñ	.ðp>ð �4˜˜j¨&Ð0Ñ1Ñ2Ñ
3ðp>ð ð	p>ð
 ˜‘ðp>ð ˜˜h¨¨S°%Ð7Ñ8Ñ9ðp>ð ˜˜x¨¨c°5Ð8Ñ9Ñ:ðp>ð �s‰mðp>ð �JÑðp>ð ˜;Ñ'ðp>ð �VÑðp>ð ðp>ð 
õp>ðl +/ñL
Ø
�(‰(�-‰-ðL
à	�‰×	$Ñ	$ðL
ð ˜;Ñ'ðL
ð 
õ	L
ò^ð ‡=�=×Ñ�h×ÑÝ8Ý=Ý<Ý?Ý=õ÷÷ Hà€HØ$€NØ€DØ€KØ €LØ�Jà€HØ€NØ€DØ€KØ€LØ€Jð 
×	Ñ	€Ø‡\‚\€Ø‡m�m€Ø‡m‚m€Ø
×
Ò
€Ø×%Ñ%€Ø×-Ò-Ð Ø×Ò€	Ø×Ò€	Ø
×
Ñ
€Ø×+Ò+€Ø×+Ò+€Ø
×
Ò
€Ø�Š€Ø×Ò€Ø×!Ò!€
Ø×!Ò!�
r%   