
    U-ff                        d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZi ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?	Zi d@ e                                D             ZdAedBefdCZ G dD dEej        e          Z  G dF dGe           Z! e!d(          Z" e!dH          Z# G dI dJej$                  Z% G dK dLej$        ej&                  Z& G dM dNe           Z' e'dO          Z( e'dP          Z) e'dQ          Z* e'dR          Z+ e'dS          Z, e'dT          Z- e'dU          Z. e'dV          Z/ G dW dXej                  Z0 G dY dZej$                  Z1 G d[ d\e1          Z2 G d] d^ej$                  Z3 G d_ d`          Z4 edadbc          Z5 G dd dbe3          Z6 G de dfe6          Z7 G dg dhe6          Z8 G di dje2          Z9 G dk dle3          Z: G dm dne1          Z; G do dpe3          Z< G dq dre<          Z= G ds dte<          Z> G du dve2          Z? G dw dxej$                  Z@ G dy dze2          ZA G d{ d|ej$                  ZB G d} d~e3          ZC G d de2          ZD G d deC          ZEdS )zACME protocol messages.    )HashableN)Any)Dict)Iterator)List)Mapping)MutableMapping)Optional)Tuple)Type)TypeVar)
challenges)errors)fields)jws)utilzurn:ietf:params:acme:error:accountDoesNotExistz4The request specified an account that does not existalreadyRevokedzOThe request specified a certificate to be revoked that has already been revokedbadCSRz2The CSR is unacceptable (e.g., due to a short key)badNoncez1The client sent an unacceptable anti-replay noncebadPublicKeyz>The JWS was signed by a public key the server does not supportbadRevocationReasonz;The revocation reason provided is not allowed by the serverbadSignatureAlgorithmz@The JWS was signed with an algorithm the server does not supportcaaz\Certification Authority Authorization (CAA) records forbid the CA from issuing a certificatecompoundzBSpecific error conditions are indicated in the "subproblems" array
connectionz?The server could not connect to the client to verify the domaindnszAThere was a problem with a DNS query during identifier validationdnssecz4The server could not validate a DNSSEC signed domainincorrectResponsez;Response received didn't match the challenge's requirementsinvalidEmailz1The provided email for a registration was invalidinvalidContactz$The provided contact URI was invalid	malformedz!The request message was malformedrejectedIdentifierz9The server will not issue certificates for the identifierzLThe request attempted to finalize an order that is not ready to be finalizedz,There were too many requests of a given typez(The server experienced an internal errorz=The server experienced a TLS error during domain verificationz)The client lacks sufficient authorizationz@A contact URL for an account used an unsupported protocol schemez*The server could not resolve a domain namez'An identifier is of an unsupported typez,The server requires external account binding)	orderNotReadyrateLimitedserverInternaltlsunauthorizedunsupportedContactunknownHostunsupportedIdentifierexternalAccountRequiredc                 *    i | ]\  }}t           |z   |S  )ERROR_PREFIX).0namedescs      \/home/cdr/domains/dharristours.com/map/certbot/lib/python3.11/site-packages/acme/messages.py
<dictcomp>r4   ;   s0       ",$L4      errreturnc                 Z    t          | t                    r| j        t          | j        v S dS )z#Check if argument is an ACME error.NF)
isinstanceErrortypr/   )r6   s    r3   is_acme_errorr<   @   s-    #u '37#6sw&&5r5   c                        e Zd ZU dZdZeZeed f         e	d<   deddf fdZ
defdZed	edd fd
            ZdefdZdedefdZdefdZ xZS )	_ConstantzACME constant.r1   POSSIBLE_NAMESr1   r7   Nc                 j    t                                                       | | j        |<   || _        d S N)super__init__r@   r1   selfr1   	__class__s     r3   rD   z_Constant.__init__L   s1    $(D!			r5   c                     | j         S rB   r?   rF   s    r3   to_partial_jsonz_Constant.to_partial_jsonQ   s
    yr5   jobjc                 f    || j         vrt          j        | j         d          | j         |         S )Nz not recognized)r@   joseDeserializationError__name__clsrK   s     r3   	from_jsonz_Constant.from_jsonT   s:    s)))+s|,L,L,LMMM!$''r5   c                 0    | j         j         d| j         dS )N())rG   rO   r1   rI   s    r3   __repr__z_Constant.__repr__Z   s     .)88DI8888r5   otherc                 \    t          |t          |                     o|j        | j        k    S rB   )r9   typer1   )rF   rW   s     r3   __eq__z_Constant.__eq__]   s&    %d,,Hty1HHr5   c                 8    t          | j        | j        f          S rB   )hashrG   r1   rI   s    r3   __hash__z_Constant.__hash__`   s    T^TY/000r5   )rO   
__module____qualname____doc__	__slots__NotImplementedr@   r   str__annotations__rD   rJ   classmethodrR   rV   r   boolrZ   intr]   __classcell__rG   s   @r3   r>   r>   G   s        I-;NDk)*;;;S T      
     (S ([ ( ( ( [(
9# 9 9 9 9IC ID I I I I1# 1 1 1 1 1 1 1 1r5   r>   c                   2    e Zd ZU dZi Zeeef         ed<   dS )IdentifierTypezACME identifier type.r@   N	rO   r^   r_   r`   r@   r   rc   r>   rd   r.   r5   r3   rk   rk   d   s1         +-NDi(-----r5   rk   ipc                   v    e Zd ZU dZ ej        dej                  Zee	d<    ej        d          Z
ee	d<   dS )
IdentifierzJACME identifier.

    :ivar IdentifierType typ:
    :ivar str value:

    rY   decoderr;   valueN)rO   r^   r_   r`   rM   fieldrk   rR   r;   rd   rr   rc   r.   r5   r3   ro   ro   m   s^           %$*V^5MNNNCNNNG$$E3$$$$$r5   ro   c                      e Zd ZU dZ ej        ddd          Zeed<    ej        dd          Z	eed<    ej        d	d          Z
eed	<    ej        d
ej        d          Zed         ed
<    ej        dd          Zeed                  ed<   ej        deeeef                  ded         fd            Zedededd fd            Zedee         fd            Zedee         fd            ZdededdfdZdefdZdS )r:   a  ACME error.

    https://datatracker.ietf.org/doc/html/rfc7807

    Note: Although Error inherits from JSONObjectWithFields, which is immutable,
    we add mutability for Error to comply with the Python exception API.

    :ivar str typ:
    :ivar str title:
    :ivar str detail:
    :ivar Identifier identifier:
    :ivar tuple subproblems: An array of ACME Errors which may be present when the CA
            returns multiple errors related to the same request, `tuple` of `Error`.

    rY   Tzabout:blank	omitemptydefaultr;   titlerv   detail
identifierrq   rv   ro   subproblems)r:   .rr   r7   c                 4    t          d | D                       S )Nc              3   J   K   | ]}t                               |          V  d S rB   )r:   rR   )r0   
subproblems     r3   	<genexpr>z$Error.subproblems.<locals>.<genexpr>   s.      IIZU__Z00IIIIIIr5   tuplerr   s    r3   r}   zError.subproblems   s    II5IIIIIIr5   codekwargsc                 `    |t           vrt          d|z            t          |z   } | dd|i|S )zCreate an Error instance with an ACME Error code.

        :str code: An ACME error code, like 'dnssec'.
        :kwargs: kwargs to pass to Error.

        z4The supplied code: %s is not a known ACME error coder;   r.   )ERROR_CODES
ValueErrorr/   )rQ   r   r   r;   s       r3   	with_codezError.with_code   sU     {"" %'+, - - -T! s%%s%f%%%r5   c                 @    t                               | j                  S )zHardcoded error description based on its type.

        :returns: Description if standard ACME error or ``None``.
        :rtype: str

        )ERROR_TYPE_DESCRIPTIONSgetr;   rI   s    r3   descriptionzError.description   s     '**48444r5   c                 z    t          | j                                      dd          d         }|t          v r|S dS )zACME error code.

        Basically self.typ without the ERROR_PREFIX.

        :returns: error code if standard ACME code or ``None``.
        :rtype: str

        :   )maxsplitN)rc   r;   rsplitr   )rF   r   s     r3   r   z
Error.code   s>     48}}##C!#44R8;Ktr5   r1   Nc                 :    t                               | ||          S rB   )object__setattr__)rF   r1   rr   s      r3   r   zError.__setattr__   s    !!$e444r5   c                 .   d                     d | j        | j        | j        | j        fD                                                       }| j        rd| j        j         d|z   }| j        r*t          | j                  dk    r| j        D ]
}|d| z  }|S )Ns    :: c              3   F   K   | ]}||                     dd          V  d S )Nasciibackslashreplaceencode)r0   parts     r3   r   z Error.__str__.<locals>.<genexpr>   sC       ! !9= KK!344! !r5   zProblem for z: r   
)
joinr;   r   rz   rx   decoder{   rr   r}   len)rF   resultr   s      r3   __str__zError.__str__   s     ! !Xt'djA! ! ! ! ! "( 	 ? 	G=DO$9===FF 	,D$4 5 5 9 9". , ,
+z+++r5   )rO   r^   r_   r`   rM   rs   r;   rc   rd   rx   rz   ro   rR   r{   r
   r}   r   rq   r   r   r   re   r   propertyr   r   r   r   r.   r5   r3   r:   r:   x   s
          tz&D-HHHCHHHGt444E3444$*X666FC666)3j2d*D *D *DJ& D D D1;MUY1Z1Z1ZK%-.ZZZ J4S#X/ JE,4G J J J J &S &C &G & & & [& 5Xc] 5 5 5 X5 hsm    X5 5C 5D 5 5 5 5
 
 
 
 
 
 
r5   r:   c                   2    e Zd ZU dZi Zeeef         ed<   dS )StatuszACME "status" field.r@   Nrl   r.   r5   r3   r   r      s1         +-NDi(-----r5   r   unknownpending
processingvalidinvalidrevokedreadydeactivatedc                       e Zd ZdZ G d dej                  Zdeee	f         ddfdZ
dede	fd	Zdede	fd
Zdeee	f         fdZedeee	f         dd fd            ZdS )	DirectoryzmDirectory.

    Directory resources must be accessed by the exact field name in RFC8555 (section 9.7.5).
    c                   :    e Zd ZU dZ ej        dd          Zeed<    ej        dd          Z	eed<    ej        dd          Z
ee         ed<    ej        d	d          Zeed
<   deddf fdZedefd            Zdee         f fdZdedefdZ xZS )Directory.MetazDirectory Meta.termsOfServiceTry   _terms_of_servicewebsitecaaIdentitiescaa_identitiesr,   external_account_requiredr   r7   Nc                 |      fd|                                 D             } t                      j        di | d S )Nc                 B    i | ]\  }}                     |          |S r.   _internal_namer0   kvrF   s      r3   r4   z+Directory.Meta.__init__.<locals>.<dictcomp>   s-    KKKDAqd))!,,aKKKr5   r.   itemsrC   rD   rF   r   rG   s   ` r3   rD   zDirectory.Meta.__init__   sH    KKKKFLLNNKKKFEGG&&v&&&&&r5   c                     | j         S )zURL for the CA TOS)r   rI   s    r3   terms_of_servicezDirectory.Meta.terms_of_service   s     ))r5   c              #   z   K   t                                                      D ]}|dk    r
|dd          n|V  d S )Nr   r   rC   __iter__rE   s     r3   r   zDirectory.Meta.__iter__   s\       ((** H H"&*="="=d122hh4GGGGH Hr5   r1   c                     |dk    rd|z   n|S )Nr   _r.   rF   r1   s     r3   r   zDirectory.Meta._internal_name   s    !%);!;!;3::Er5   )rO   r^   r_   r`   rM   rs   r   rc   rd   r   r   r   r   rf   r   rD   r   r   r   r   r   rh   ri   s   @r3   Metar      sc        !+,<!M!M!M3MMM!tz)t<<<<<<$.DJ$$O$O$OS	OOO*4$*5NZ^*_*_*_!4___	'S 	'T 	' 	' 	' 	' 	' 	' 
	*c 	* 	* 	* 
	*	Hhsm 	H 	H 	H 	H 	H 	H	Fs 	Fs 	F 	F 	F 	F 	F 	F 	F 	Fr5   r   rK   r7   Nc                     || _         d S rB   )_jobjrF   rK   s     r3   rD   zDirectory.__init__   s    


r5   r1   c                 p    	 | |         S # t           $ r!}t          t          |                    d }~ww xY wrB   )KeyErrorAttributeErrorrc   )rF   r1   errors      r3   __getattr__zDirectory.__getattr__   sD    	-: 	- 	- 	- U,,,	-s   
 
505c                 `    	 | j         |         S # t          $ r t          d| d          w xY w)NzDirectory field "z" not found)r   r   r   s     r3   __getitem__zDirectory.__getitem__  sN    	B:d## 	B 	B 	B@t@@@AAA	Bs    -c                 8    t          j        | j        d           S )Nc                     | S rB   r.   )r   s    r3   <lambda>z+Directory.to_partial_json.<locals>.<lambda>  s    1 r5   )r   map_keysr   rI   s    r3   rJ   zDirectory.to_partial_json  s    }TZ555r5   c                 z    | j                             |                    di                     |d<    | |          S )Nmeta)r   rR   poprP   s     r3   rR   zDirectory.from_json  s7    x))$((62*>*>??Vs4yyr5   )rO   r^   r_   r`   rM   JSONObjectWithFieldsr   r   rc   r   rD   r   r   r   rJ   re   r	   rR   r.   r5   r3   r   r      s"        
F F F F Ft( F F F2WS#X. 4    - - - - - -B B B B B B6c3h 6 6 6 6 ^CH5 +    [  r5   r   c                   >    e Zd ZU dZ ej        d          Zded<   dS )ResourcezOACME Resource.

    :ivar acme.messages.ResourceBody body: Resource body.

    bodyResourceBodyN)rO   r^   r_   r`   rM   rs   r   rd   r.   r5   r3   r   r     s:          
 &4:f--D.-----r5   r   c                   >    e Zd ZU dZ ej        d          Zeed<   dS )ResourceWithURIzKACME Resource with URI.

    :ivar str uri: Location of the resource.

    uriN)	rO   r^   r_   r`   rM   rs   r   rc   rd   r.   r5   r3   r   r     s:          
 tz%  C     r5   r   c                       e Zd ZdZdS )r   zACME Resource Body.NrO   r^   r_   r`   r.   r5   r3   r   r   '  s        r5   r   c                   X    e Zd ZdZedej        dededede	ee
f         f
d            ZdS )	ExternalAccountBindingzACME External Account Bindingaccount_public_keykidhmac_key	directoryr7   c                    t          j        |                                                                          }t          j                            |          }|d         }t          j        	                    |t          j
                            |          t          j        j        d||          }|                                S )zLCreate External Account Binding Resource from contact details, kid and hmac.
newAccount)keyN)jsondumpsrJ   r   rM   b64	b64decoder   JWSsignjwkJWKOctjwaHS256)	rQ   r   r   r   r   key_jsondecoded_hmac_keyurleabs	            r3   	from_dataz ExternalAccountBinding.from_data.  s    
 :0@@BBCCJJLL8--h77%gll8TX__9I_%J%J8>4% % ""$$$r5   N)rO   r^   r_   r`   re   rM   JWKrc   r   r   r   r   r.   r5   r3   r   r   +  sg        ''%48 %# % %&%+/S>% % % [% % %r5   r   GenericRegistrationRegistration)boundc                       e Zd ZU dZ ej        ddej        j                  Zej        e	d<    ej        ddd          Z
eedf         e	d<    ej        d	d
          Zee	d	<    ej        dd
          Zee	d<    ej        dd
          Zee	d<    ej        dd
          Zee	d<    ej        dd
          Zeeef         e	d<   dZdZe	 	 	 d$dee         dee         dee         deeeef                  dedefd            Zdeddf fdZdedeedf         fdZdeeef         deeef         fdZdeeef         f fd Z deeef         f fd!Z!e"deedf         fd"            Z#e"deedf         fd#            Z$ xZ%S )%r  zRegistration Resource Body.

    :ivar jose.JWK key: Public key.
    :ivar tuple contact: Contact information following ACME spec,
        `tuple` of `str`.
    :ivar str agreement:

    r   Trv   rq   contactr.   ru   .	agreementry   statustermsOfServiceAgreedterms_of_service_agreedonlyReturnExistingonly_return_existingexternalAccountBindingexternal_account_bindingztel:zmailto:NrQ   phoneemailr   r7   c                 F    d|v }t          |                    dd                    }||                     j        |z              |4|                     fd|                    d          D                        |s|rt          |          |d<   |r||d<     di |S )a  
        Create registration resource from contact details.

        The `contact` keyword being passed to a Registration object is meaningful, so
        this function represents empty iterables in its kwargs by passing on an empty
        `tuple`.
        r  r.   Nc                 $    g | ]}j         |z   S r.   )email_prefix)r0   mailrQ   s     r3   
<listcomp>z*Registration.from_data.<locals>.<listcomp>p  s!    QQQC,t3QQQr5   ,r  )listr   appendphone_prefixextendsplitr   )rQ   r  r  r  r   contact_provideddetailss   `      r3   r   zRegistration.from_data[  s     %. vzz)R0011NN3+e3444NNQQQQC@P@PQQQRRR  	/& 	/ %gF9# 	J1IF-.s}}V}}r5   c                     d|v r$|d         t                               | dd            t                      j        di | dS )z;Note if the user provides a value for the `contact` member.r  N_add_contactTr.   )r   r   rC   rD   r   s     r3   rD   zRegistration.__init__|  sS    6)#4#@t^T:::""6"""""r5   prefixc                 D    t          fd| j        D                       S )Nc              3   p   K   | ]0}|                               |t                    d          V  1d S rB   )
startswithr   )r0   rz   r   s     r3   r   z/Registration._filter_contact.<locals>.<genexpr>  sZ       * *%+  ((*3v;;<< * * * * * *r5   )r   r  )rF   r   s    `r3   _filter_contactzRegistration._filter_contact  s=     * * * */3|* * * * * 	*r5   rK   c                 X    t          | dd          r|                     d          |d<   |S )a  
        The `contact` member of Registration objects should not be required when
        de-serializing (as it would be if the Fields' `omitempty` flag were `False`), but
        it should be included in serializations if it was provided.

        :param jobj: Dictionary containing this Registrations' data
        :type jobj: dict

        :returns: Dictionary containing Registrations data to transmit to the server
        :rtype: dict
        r  Fr  )getattrr   r   s     r3   _add_contact_if_appropriatez(Registration._add_contact_if_appropriate  s2     4// 	5"kk)44DOr5   c                 n    t                                                      }|                     |          S )z2Modify josepy.JSONDeserializable.to_partial_json())rC   rJ   r'  rF   rK   rG   s     r3   rJ   zRegistration.to_partial_json  s,    ww&&((//555r5   c                 n    t                                                      }|                     |          S )z;Modify josepy.JSONObjectWithFields.fields_to_partial_json())rC   fields_to_partial_jsonr'  r)  s     r3   r+  z#Registration.fields_to_partial_json  s,    ww--////555r5   c                 6    |                      | j                  S )z*All phones found in the ``contact`` field.)r$  r  rI   s    r3   phoneszRegistration.phones       ##D$5666r5   c                 6    |                      | j                  S )z*All emails found in the ``contact`` field.)r$  r  rI   s    r3   emailszRegistration.emails  r.  r5   )NNN)&rO   r^   r_   r`   rM   rs   r   rR   r   rd   r  r   rc   r  r  r   r
  rf   r  r  r   r   r  r  re   r   r  r
   r   rD   r$  r'  rJ   r+  r   r-  r0  rh   ri   s   @r3   r  r  A  s          DJudh>PQQQCQQQ  *tz)tRPPPGU38_PPPTZt<<<Is<<<TZD999FF999$.DJ/EQU$V$V$VTVVV!+,@D!Q!Q!Q$QQQ/9tz:RDH0J 0J 0Jd38n J J J LLIM)-GK t/0 # !#,4T#s(^,D   %8   [@# # # # # # # #*c *eCHo * * * *
S#X 4S>    "6c3h 6 6 6 6 6 6
6S#X 6 6 6 6 6 6
 7c3h 7 7 7 X7 7c3h 7 7 7 X7 7 7 7 7r5   c                       e Zd ZdZdS )NewRegistrationzNew registration.Nr   r.   r5   r3   r2  r2    s        r5   r2  c                       e Zd ZdZdS )UpdateRegistrationzUpdate registration.Nr   r.   r5   r3   r4  r4    s        r5   r4  c                       e Zd ZU dZ ej        dej                  Zee	d<    ej        dd          Z
ee	d<    ej        dd          Zee	d<   dS )	RegistrationResourcezRegistration Resource.

    :ivar acme.messages.Registration body:
    :ivar str new_authzr_uri: Deprecated. Do not use.
    :ivar str terms_of_service: URL for the CA TOS.

    r   rp   new_authzr_uriTry   r   N)rO   r^   r_   r`   rM   rs   r  rR   r   rd   r7  rc   r   r.   r5   r3   r6  r6    s           $FL4JKKKD,KKK$$*%5FFFNCFFF&DJ'9TJJJcJJJJJr5   r6  c                       e Zd ZU dZdZ ej        ddd          Zee	d<    ej        de
j        de	          Ze
e	d<    ej        d
d          Zej        e	d
<    ej        dej        dd	          Zee	d<   deddf fdZdedef fdZdeeef         f fdZedeeef         deeef         f fd            Zedefd            ZdedefdZdee         f fdZ dedefdZ! xZ"S )ChallengeBodya>  Challenge Resource Body.

    .. todo::
       Confusingly, this has a similar name to `.challenges.Challenge`,
       as well as `.achallenges.AnnotatedChallenge`. Please use names
       such as ``challb`` to distinguish instances of this class from
       ``achall``.

    :ivar acme.challenges.Challenge: Wrapped challenge.
        Conveniently, all challenge fields are proxied, i.e. you can
        call ``challb.x`` to get ``challb.chall.x`` contents.
    :ivar acme.messages.Status status:
    :ivar datetime.datetime validated:
    :ivar messages.Error error:

    )challr   TNru   _urlr  )rq   rv   rw   	validatedry   r   r   r7   c                 |      fd|                                 D             } t                      j        di | d S )Nc                 B    i | ]\  }}                     |          |S r.   r   r   s      r3   r4   z*ChallengeBody.__init__.<locals>.<dictcomp>  s-    GGG1$%%a((!GGGr5   r.   r   r   s   ` r3   rD   zChallengeBody.__init__  sH    GGGGGGG""6"""""r5   r1   c                 l    t                                          |                     |                    S rB   )rC   r   r   rE   s     r3   r   zChallengeBody.encode  s'    ww~~d11$77888r5   c                     t                                                      }|                    | j                                                   |S rB   )rC   rJ   updater:  r)  s     r3   rJ   zChallengeBody.to_partial_json  s=    ww&&((DJ..00111r5   rK   c                     t                                          |          }t          j                            |          |d<   |S )Nr:  )rC   fields_from_jsonr   	ChallengerR   )rQ   rK   jobj_fieldsrG   s      r3   rC  zChallengeBody.fields_from_json  s;    gg..t44)3==dCCGr5   c                     | j         S )zThe URL of this challenge.)r;  rI   s    r3   r   zChallengeBody.uri  s     yr5   c                 ,    t          | j        |          S rB   )r&  r:  r   s     r3   r   zChallengeBody.__getattr__  s    tz4(((r5   c              #   j   K   t                                                      D ]}|dk    rdn|V  d S )Nr;  r   r   rE   s     r3   r   zChallengeBody.__iter__  sM       GG$$&& 	4 	4D6>>%%t3333	4 	4r5   c                     |dk    rdn|S )Nr   r;  r.   r   s     r3   r   zChallengeBody._internal_name   s    vvD0r5   )#rO   r^   r_   r`   ra   rM   rs   r;  rc   rd   r   rR   STATUS_PENDINGr  r   rfc3339r<  datetimer:   r   r   rD   r   r   rJ   re   r   rC  r   r   r   r   r   r   rh   ri   s   @r3   r9  r9    sL           I
 
5D$???D#???TZ&2B"&@ @ @FF @ @ @#16>+#N#N#NIx NNN4:gu!%t5 5 5E5 5 5 5# # # # # # # #93 93 9 9 9 9 9 9c3h      
 GCH$5 $sCx.      [
 S    X) ) ) ) ) )4(3- 4 4 4 4 4 413 13 1 1 1 1 1 1 1 1r5   r9  c                       e Zd ZU dZ ej        dej                  Zee	d<    ej        d          Z
ee	d<   edefd            ZdS )ChallengeResourcezChallenge Resource.

    :ivar acme.messages.ChallengeBody body:
    :ivar str authzr_uri: URI found in the 'up' ``Link`` header.

    r   rp   
authzr_urir7   c                     | j         j        S )zThe URL of the challenge body.)r   r   rI   s    r3   r   zChallengeResource.uri  s     y}r5   N)rO   r^   r_   r`   rM   rs   r9  rR   r   rd   rO  rc   r   r   r.   r5   r3   rN  rN    s           %$*V]5LMMMD-MMM dj..J...S    X  r5   rN  c                   ~   e Zd ZU dZ ej        dej        d          Zee	d<    ej        dd          Z
ee         e	d<    ej        ddej                  Zee	d<    ej        d	d          Zej        e	d	<    ej        d
d          Zee	d
<   e
j        deeeef                  deedf         fd            Z
dS )AuthorizationzAuthorization Resource Body.

    :ivar acme.messages.Identifier identifier:
    :ivar list challenges: `list` of `.ChallengeBody`
    :ivar acme.messages.Status status:
    :ivar datetime.datetime expires:

    r{   Tr|   r   ry   r  r  expireswildcardrr   r7   .c                 4    t          d | D                       S )Nc              3   J   K   | ]}t                               |          V  d S rB   )r9  rR   )r0   r:  s     r3   r   z+Authorization.challenges.<locals>.<genexpr>,  s0      GG],,U33GGGGGGr5   r   r   s    r3   r   zAuthorization.challenges*  s    GGGGGGGGr5   N)rO   r^   r_   r`   rM   rs   ro   rR   r{   rd   r   r   r9  r   r  r   rK  rS  rL  rT  rf   rq   r   rc   r   r   r.   r5   r3   rR  rR    s-          (TZj>R^bcccJ
ccc&0dj&N&N&NJ]#NNNTZD&BRSSSFFSSS
 "0	T!J!J!JGXJJJTZ
d;;;Hd;;; H$tCH~. H59K3L H H H H H Hr5   rR  c                       e Zd ZdZdS )NewAuthorizationzNew authorization.Nr   r.   r5   r3   rX  rX  /  s        r5   rX  c                       e Zd ZdZdS )UpdateAuthorizationzUpdate authorization.Nr   r.   r5   r3   rZ  rZ  3  s        r5   rZ  c                   z    e Zd ZU dZ ej        dej                  Zee	d<    ej        dd          Z
ee	d<   dS )AuthorizationResourcez~Authorization Resource.

    :ivar acme.messages.Authorization body:
    :ivar str new_cert_uri: Deprecated. Do not use.

    r   rp   new_cert_uriTry   N)rO   r^   r_   r`   rM   rs   rR  rR   r   rd   r]  rc   r.   r5   r3   r\  r\  7  sc           %$*V]5LMMMD-MMM"
>TBBBL#BBBBBr5   r\  c                   b    e Zd ZU dZ ej        dej        ej                  Zej	        e
d<   dS )CertificateRequestz~ACME newOrder request.

    :ivar jose.ComparableX509 csr:
        `OpenSSL.crypto.X509Req` wrapped in `.ComparableX509`

    csrrq   encoderN)rO   r^   r_   r`   rM   rs   
decode_csr
encode_csrr`  ComparableX509rd   r.   r5   r3   r_  r_  B  sJ            *tz%RVRabbbC	bbbbbr5   r_  c                   x    e Zd ZU dZ ej        d          Zeed<    ej        d          Z	e
edf         ed<   dS )CertificateResourcea  Certificate Resource.

    :ivar josepy.util.ComparableX509 body:
        `OpenSSL.crypto.X509` wrapped in `.ComparableX509`
    :ivar str cert_chain_uri: URI found in the 'up' ``Link`` header
    :ivar tuple authzrs: `tuple` of `AuthorizationResource`.

    cert_chain_uriauthzrs.N)rO   r^   r_   r`   rM   rs   rh  rc   rd   ri  r   r\  r.   r5   r3   rg  rg  L  sb           %$*%566NC6661;I1F1FGU(#-.FFFFFr5   rg  c                       e Zd ZU dZ ej        dej        ej                  Zej	        e
d<    ej        d          Zee
d<   dS )
RevocationzRevocation message.

    :ivar jose.ComparableX509 certificate: `OpenSSL.crypto.X509` wrapped in
        `jose.ComparableX509`

    certificatera  reasonN)rO   r^   r_   r`   rM   rs   decode_certencode_certrl  re  rd   rm  rg   r.   r5   r3   rk  rk  Y  sy           (2tzt/9I(K (K (KK$ K K K$*X&&FC&&&&&r5   rk  c                      e Zd ZU dZ ej        dd          Zee         e	d<    ej        de
j        d          Ze
e	d<    ej        dd          Zee         e	d<    ej        dd          Zee	d<    ej        d	d          Zee	d	<    ej        d
d          Zej        e	d
<    ej        ddej                  Zee	d<   ej        deeeef                  deedf         fd            ZdS )Ordera_  Order Resource Body.

    :ivar identifiers: List of identifiers for the certificate.
    :vartype identifiers: `list` of `.Identifier`
    :ivar acme.messages.Status status:
    :ivar authorizations: URLs of authorizations.
    :vartype authorizations: `list` of `str`
    :ivar str certificate: URL to download certificate as a fullchain PEM.
    :ivar str finalize: URL to POST to to request issuance once all
        authorizations have "valid" status.
    :ivar datetime.datetime expires: When the order expires.
    :ivar ~.Error error: Any error that occurred during finalization, if applicable.
    identifiersTry   r  r|   authorizationsrl  finalizerS  r   r  rr   r7   .c                 4    t          d | D                       S )Nc              3   J   K   | ]}t                               |          V  d S rB   )ro   rR   )r0   r{   s     r3   r   z$Order.identifiers.<locals>.<genexpr>  s0      NN*Z))*55NNNNNNr5   r   r   s    r3   rr  zOrder.identifiers}  s    NNNNNNNNr5   N)rO   r^   r_   r`   rM   rs   rr  r   ro   rd   r   rR   r  rs  rc   rl  rt  r   rK  rS  rL  r:   r   rq   r   r   r   r.   r5   r3   rq  rq  e  so          %/DJ}$M$M$MKj!MMMTZ&2BdSSSFFSSS *
+;t L L LNDILLL!tz-4@@@K@@@DJzT:::Hc:::!/	T!J!J!JGXJJJ4:guOOOE5OOO O4S#X/ OE*c/4J O O O O O Or5   rq  c                   v   e Zd ZU dZ ej        dej                  Zee	d<    ej        ddd d           Z
ee	d<    ej        d	          Zee         e	d	<    ej        d
d          Zee	d
<    ej        dd          Zee         e	d<   ej        deeeef                  deedf         fd            ZdS )OrderResourcea  Order Resource.

    :ivar acme.messages.Order body:
    :ivar bytes csr_pem: The CSR this Order will be finalized with.
    :ivar authorizations: Fully-fetched AuthorizationResource objects.
    :vartype authorizations: `list` of `acme.messages.AuthorizationResource`
    :ivar str fullchain_pem: The fetched contents of the certificate URL
        produced once the order was finalized, if it's present.
    :ivar alternative_fullchains_pem: The fetched contents of alternative certificate
        chain URLs produced once the order was finalized, if present and requested during
        finalization.
    :vartype alternative_fullchains_pem: `list` of `str`
    r   rp   csr_pemTc                 ,    |                      d          S Nzutf-8r   )ss    r3   r   zOrderResource.<lambda>      !((72C2C r5   c                 ,    |                      d          S r{  )r   )bs    r3   r   zOrderResource.<lambda>  r}  r5   )rv   rq   rb  rs  fullchain_pemry   alternative_fullchains_pemrr   r7   .c                 4    t          d | D                       S )Nc              3   J   K   | ]}t                               |          V  d S rB   )r\  rR   )r0   authzs     r3   r   z/OrderResource.authorizations.<locals>.<genexpr>  s1      OO*44U;;OOOOOOr5   r   r   s    r3   rs  zOrderResource.authorizations  s    OOOOOOOOr5   N)rO   r^   r_   r`   rM   rs   rq  rR   r   rd   ry  bytesrs  r   r\  r  rc   r  rq   r   r   r   r.   r5   r3   rx  rx    sZ          $*VU_===D%===TZ	T )D(C(C(C	E 	E 	EGU 	E 	E 	E 3=$*=M2N2NND./NNN#OtDDDM3DDD,6DJ7SAE-G -G -GS	 G G G
 Pd4S>2 Pu=RTW=W7X P P P P P Pr5   rx  c                       e Zd ZdZdS )NewOrderz
New order.Nr   r.   r5   r3   r  r    s        r5   r  )Fr`   collections.abcr   rL  r   typingr   r   r   r   r   r	   r
   r   r   r   josepyrM   acmer   r   r   r   r   r/   r   r   r   BaseExceptionrf   r<   JSONDeSerializabler>   rk   IDENTIFIER_FQDNIDENTIFIER_IPr   ro   r:   r   STATUS_UNKNOWNrJ  STATUS_PROCESSINGSTATUS_VALIDSTATUS_INVALIDSTATUS_REVOKEDSTATUS_READYSTATUS_DEACTIVATEDr   r   r   r   r   r  r  r2  r4  r6  r9  rN  rR  rX  rZ  r\  r_  rg  rk  rq  rx  r  r.   r5   r3   <module>r     s      $ $ $ $ $ $                                 ! ! ! ! ! !                                                          ,Q  B	
 C T X _ 
  T   
N D  X!$ G%& <'( 4)* U+, dA@J?\?FM=  B  0;0A0A0C0C    
}     1 1 1 1 1' 1 1 1:. . . . .Y . . .
 !.''t$$% % % % %* % % %T T T T TD%v| T T Tn. . . . .Y . . .
 	""	""F<(( vg	""	""vgVM** 4 4 4 4 4' 4 4 4n. . . . .t( . . .! ! ! ! !h ! ! !    4,   % % % % % % % %& g3>JJJ j7 j7 j7 j7 j7< j7 j7 j7Z    l          
K 
K 
K 
K 
K? 
K 
K 
K>1 >1 >1 >1 >1L >1 >1 >1B        H H H H HL H H H6    }            -      C C C C CO C C Cc c c c c2 c c c
G 
G 
G 
G 
G/ 
G 
G 
G	' 	' 	' 	' 	'* 	' 	' 	'O O O O OL O O O:#P #P #P #P #PO #P #P #PL    u     r5   