
_c           @   s  d  Z  d d l 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 y d d	 l m Z Wn! e k
 r d d	 l m Z n Xd
 Z d Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d  d! 6d" d# 6d$ d% 6d& d' 6d( d) 6d* d+ 6d, d- 6d. d/ 6d0 d1 6d2 d3 6d4 d5 6d6 d7 6d8 d9 6d: d; 6d< d= 6d> d? 6Z e d@   e j   D  Z e j e dA   e j   D   dB   Z e j dC e j e j f dD     Y Z dE e j e f dF     YZ dG e f dH     YZ e dI  Z e dJ  Z  e dK  Z! e dL  Z" e dM  Z# e dN  Z$ e dO  Z% e dP  Z& dQ e f dR     YZ' e' d!  Z( dS e j f dT     YZ) dU e j f dV     YZ* dW e j f dX     YZ+ dY e+ f dZ     YZ, d[ e j f d\     YZ- d] e. f d^     YZ/ d_ e- f d`     YZ0 e* j1 da e e0 f db     Y Z2 dc e e0 f dd     YZ3 de e, f df     YZ4 dg e- f dh     YZ5 di e+ f dj     YZ6 dk e- f dl     YZ7 e* j1 dm e e7 f dn     Y Z8 do e e7 f dp     YZ9 dq e, f dr     YZ: e* j1 ds e e j f dt     Y Z; du e, f dv     YZ< e* j1 dw e e j f dx     Y Z= dy e- f dz     YZ> d{ e, f d|     YZ? e* j1 d} e> f d~     Y Z@ d S(   s   ACME protocol messages.iN(   t
   challenges(   t   errors(   t   fields(   t   jws(   t   util(   t   ResourceMixin(   t   Hashables   urn:acme:error:s   urn:ietf:params:acme:error:s4   The request specified an account that does not existt   accountDoesNotExistsO   The request specified a certificate to be revoked that has already been revokedt   alreadyRevokeds2   The CSR is unacceptable (e.g., due to a short key)t   badCSRs1   The client sent an unacceptable anti-replay noncet   badNonces>   The JWS was signed by a public key the server does not supportt   badPublicKeys;   The revocation reason provided is not allowed by the servert   badRevocationReasons@   The JWS was signed with an algorithm the server does not supportt   badSignatureAlgorithms\   Certification Authority Authorization (CAA) records forbid the CA from issuing a certificatet   caasB   Specific error conditions are indicated in the "subproblems" arrayt   compounds?   The server could not connect to the client to verify the domaint
   connectionsA   There was a problem with a DNS query during identifier validationt   dnss4   The server could not validate a DNSSEC signed domaint   dnssecs;   Response received didn't match the challenge's requirementst   incorrectResponses1   The provided email for a registration was invalidt   invalidEmails$   The provided contact URI was invalidt   invalidContacts!   The request message was malformedt	   malformeds9   The server will not issue certificates for the identifiert   rejectedIdentifiersL   The request attempted to finalize an order that is not ready to be finalizedt   orderNotReadys,   There were too many requests of a given typet   rateLimiteds(   The server experienced an internal errort   serverInternals=   The server experienced a TLS error during domain verificationt   tlss)   The client lacks sufficient authorizationt   unauthorizeds@   A contact URL for an account used an unsupported protocol schemet   unsupportedContacts*   The server could not resolve a domain namet   unknownHosts'   An identifier is of an unsupported typet   unsupportedIdentifiers,   The server requires external account bindingt   externalAccountRequiredc         c   s%   |  ] \ } } t  | | f Vq d  S(   N(   t   ERROR_PREFIX(   t   .0t   namet   desc(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>:   s    c         c   s%   |  ] \ } } t  | | f Vq d  S(   N(   t   OLD_ERROR_PREFIX(   R"   R#   R$   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>=   s    c         C   s>   t  |  t  r: |  j d k	 r: t |  j k p9 t |  j k St S(   s#   Check if argument is an ACME error.N(   t
   isinstancet   Errort   typt   NoneR!   R%   t   False(   t   err(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   is_acme_error@   s    R'   c           B   s   e  Z d  Z e j d d e d d Z e j d d e Z e j d d e Z e	 d    Z
 e d    Z e d	    Z d
   Z RS(   s   ACME error.

    https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00

    :ivar unicode typ:
    :ivar unicode title:
    :ivar unicode detail:

    t   typet	   omitemptyt   defaults   about:blankt   titlet   detailc         K   s9   | t  k r t d |   n  t | } |  d | |  S(   s   Create an Error instance with an ACME Error code.

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

        s4   The supplied code: %s is not a known ACME error codeR(   (   t   ERROR_CODESt
   ValueErrorR!   (   t   clst   codet   kwargsR(   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt	   with_codeV   s
    
c         C   s   t  j |  j  S(   s   Hardcoded error description based on its type.

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

        (   t   ERROR_TYPE_DESCRIPTIONSt   getR(   (   t   self(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   descriptiond   s    c         C   s0   t  |  j  j d  d } | t k r, | Sd S(   s   ACME error code.

        Basically self.typ without the ERROR_PREFIX.

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

        t   :iN(   t   strR(   t   splitR2   R)   (   R:   R5   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR5   n   s    
c         C   s5   d j  d   |  j |  j |  j |  j f D  j   S(   Ns    :: c         s   s-   |  ]# } | d k	 r | j d  d  Vq d S(   t   asciit   backslashreplaceN(   R)   t   encode(   R"   t   part(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>   s    (   t   joinR(   R;   R1   R0   t   decode(   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __str__}   s    (   t   __name__t
   __module__t   __doc__t   joset   Fieldt   TrueR(   R0   R1   t   classmethodR7   t   propertyR;   R5   RE   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR'   G   s   

t	   _Constantc           B   s_   e  Z d  Z d	 Z e Z d   Z d   Z e d    Z	 d   Z
 d   Z d   Z d   Z RS(
   s   ACME constant.R#   c         C   s-   t  t |   j   |  |  j | <| |  _ d  S(   N(   t   superRN   t   __init__t   POSSIBLE_NAMESR#   (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRP      s    c         C   s   |  j  S(   N(   R#   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   to_partial_json   s    c         C   s8   | |  j  k r- t j d j |  j    n  |  j  | S(   Ns   {0} not recognized(   RQ   RI   t   DeserializationErrort   formatRF   (   R4   t   jobj(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt	   from_json   s    c         C   s   d j  |  j j |  j  S(   Ns   {0}({1})(   RT   t	   __class__RF   R#   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __repr__   s    c         C   s%   t  | t |    o$ | j |  j k S(   N(   R&   R-   R#   (   R:   t   other(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __eq__   s    c         C   s   t  |  j |  j f  S(   N(   t   hashRW   R#   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __hash__   s    c         C   s   |  | k S(   N(    (   R:   RY   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __ne__   s    (   s   name(   RF   RG   RH   t	   __slots__t   NotImplementedRQ   RP   RR   RL   RV   RX   RZ   R\   R]   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRN      s   					t   Statusc           B   s   e  Z d  Z i  Z RS(   s   ACME "status" field.(   RF   RG   RH   RQ   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR`      s   t   unknownt   pendingt
   processingt   validt   invalidt   revokedt   readyt   deactivatedt   IdentifierTypec           B   s   e  Z d  Z i  Z RS(   s   ACME identifier type.(   RF   RG   RH   RQ   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRi      s   t
   Identifierc           B   s5   e  Z d  Z e j d d e j Z e j d  Z RS(   sN   ACME identifier.

    :ivar IdentifierType typ:
    :ivar unicode value:

    R-   t   decodert   value(	   RF   RG   RH   RI   RJ   Ri   RV   R(   Rl   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRj      s   t	   Directoryc           B   s~   e  Z d  Z i  Z d e j f d     YZ e d    Z e d    Z	 d   Z
 d   Z d   Z d   Z e d	    Z RS(
   s
   Directory.t   Metac           B   s   e  Z d  Z e j d d e Z e j d d e Z e j d d e Z e j d d e Z	 e j d d e Z
 d   Z e d    Z d	   Z d
   Z RS(   s   Directory Meta.s   terms-of-serviceR.   t   termsOfServicet   websitet   caaIdentitiesR    c            s9     f d   | j    D } t t j    j |   d  S(   Nc            s(   i  |  ] \ } } |   j  |   q S(    (   t   _internal_name(   R"   t   kt   v(   R:   (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys
   <dictcomp>   s   	 (   t   itemsRO   Rm   Rn   RP   (   R:   R6   (    (   R:   s1   /usr/lib/python2.7/site-packages/acme/messages.pyRP      s    c         C   s   |  j  p |  j S(   s   URL for the CA TOS(   t   _terms_of_servicet   _terms_of_service_v2(   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   terms_of_service   s    c         c   sB   x; t  t j |   j   D]! } | d k r5 | d n | Vq Wd  S(   NRv   i   (   RO   Rm   Rn   t   __iter__(   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRy      s    c         C   s   | d k r d | S| S(   NRx   t   _(    (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRr      s    (   RF   RG   RH   RI   RJ   RK   Rv   Rw   Rp   t   caa_identitiest   external_account_requiredRP   RM   Rx   Ry   Rr   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRn      s   		c         C   s   t  | d |  S(   Nt   resource_type(   t   getattr(   R4   t   key(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt
   _canon_key   s    c         C   s/   | j  } | |  j k s t  | |  j | <| S(   s   Register resource.(   R}   t   _REGISTERED_TYPESt   AssertionError(   R4   t   resource_body_clsR}   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   register   s    	c         C   s"   t  j | |  j  } | |  _ d  S(   N(   R   t   map_keysR   t   _jobj(   R:   RU   t
   canon_jobj(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRP      s    c         C   sD   y |  | j  d d  SWn% t k
 r? } t t |    n Xd  S(   NRz   t   -(   t   replacet   KeyErrort   AttributeErrorR=   (   R:   R#   t   error(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __getattr__   s    c         C   sM   y |  j  |  j |  SWn. t k
 rH t d |  j |  d   n Xd  S(   Ns   Directory field "s   " not found(   R   R   R   (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   __getitem__   s    c         C   s   |  j  S(   N(   R   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRR     s    c         C   s,   |  j  j | j d i    | d <|  |  S(   Nt   meta(   Rn   RV   t   pop(   R4   RU   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRV     s    "(   RF   RG   RH   R   RI   t   JSONObjectWithFieldsRn   RL   R   R   RP   R   R   RR   RV   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRm      s   				t   Resourcec           B   s   e  Z d  Z e j d  Z RS(   sO   ACME Resource.

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

    t   body(   RF   RG   RH   RI   RJ   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   
  s   t   ResourceWithURIc           B   s   e  Z d  Z e j d  Z RS(   sO   ACME Resource with URI.

    :ivar unicode uri: Location of the resource.

    t   uri(   RF   RG   RH   RI   RJ   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   ResourceBodyc           B   s   e  Z d  Z RS(   s   ACME Resource Body.(   RF   RG   RH   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   ExternalAccountBindingc           B   s   e  Z d  Z e d    Z RS(   s   ACME External Account Bindingc   	      C   sw   t  j | j    j   } t j j |  } | d } t j j	 | t j
 j d |  t j j d | |  } | j   S(   sL   Create External Account Binding Resource from contact details, kid and hmac.t
   newAccountR   N(   t   jsont   dumpsRR   RA   RI   t   b64t	   b64decodeR   t   JWSt   signt   jwkt   JWKOctt   jwat   HS256R)   (	   R4   t   account_public_keyt   kidt   hmac_keyt	   directoryt   key_jsont   decoded_hmac_keyt   urlt   eab(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt	   from_data#  s    
(   RF   RG   RH   RL   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR      s   t   Registrationc           B   s"  e  Z d  Z e j d d e d e j j Z e j d d e d d Z	 e j d d e Z
 e j d d e Z e j d d e Z e j d	 d e Z e j d
 d e Z d Z d Z e d d d d   Z d   Z d   Z d   Z d   Z d   Z e d    Z e d    Z RS(   s   Registration Resource Body.

    :ivar josepy.jwk.JWK key: Public key.
    :ivar tuple contact: Contact information following ACME spec,
        `tuple` of `unicode`.
    :ivar unicode agreement:

    R   R.   Rk   t   contactR/   t	   agreementt   statust   termsOfServiceAgreedt   onlyReturnExistingt   externalAccountBindings   tel:s   mailto:c         K   s   d | k } t  | j d d   } | d k	 rG | j |  j |  n  | d k	 r | j g  | j d  D] } |  j | ^ qi  n  | s | r t |  | d <n  | r | | d <n  |  |   S(   s  
        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   t   ,t   external_account_binding(    N(	   t   listR   R)   t   appendt   phone_prefixt   extendR>   t   email_prefixt   tuple(   R4   t   phonet   emailR   R6   t   contact_providedt   detailst   mail(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   K  s    3c         K   s<   d | k r" t  j |  d t  n  t t |   j |   d S(   s;   Note if the user provides a value for the `contact` member.R   t   _add_contactN(   t   objectt   __setattr__RK   RO   R   RP   (   R:   R6   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRP   i  s    c            s   t    f d   |  j D  S(   Nc         3   s.   |  ]$ } | j     r | t    Vq d  S(   N(   t
   startswitht   len(   R"   R1   (   t   prefix(    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>r  s    (   R   R   (   R:   R   (    (   R   s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   _filter_contactp  s    c         C   s,   t  |  d t  r( |  j d  | d <n  | S(   s  
        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   R   (   R~   R*   RA   (   R:   RU   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   _add_contact_if_appropriateu  s    c         C   s"   t  t |   j   } |  j |  S(   s2   Modify josepy.JSONDeserializable.to_partial_json()(   RO   R   RR   R   (   R:   RU   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRR     s    c         C   s"   t  t |   j   } |  j |  S(   s;   Modify josepy.JSONObjectWithFields.fields_to_partial_json()(   RO   R   t   fields_to_partial_jsonR   (   R:   RU   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    c         C   s   |  j  |  j  S(   s*   All phones found in the ``contact`` field.(   R   R   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   phones  s    c         C   s   |  j  |  j  S(   s*   All emails found in the ``contact`` field.(   R   R   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   emails  s    (    N(   RF   RG   RH   RI   RJ   RK   t   JWKRV   R   R   R   R   t   terms_of_service_agreedt   only_return_existingR   R   R   RL   R)   R   RP   R   R   RR   R   RM   R   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   2  s&   !					t   NewRegistrationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   New registration.s   new-reg(   RF   RG   RH   R}   R   R   t   resource(    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   UpdateRegistrationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   Update registration.t   reg(   RF   RG   RH   R}   R   R   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   RegistrationResourcec           B   sP   e  Z d  Z e j d d e j Z e j d d e Z	 e j d d e Z
 RS(   s   Registration Resource.

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

    R   Rk   t   new_authzr_uriR.   Rx   (   RF   RG   RH   RI   RJ   R   RV   R   RK   R   Rx   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   ChallengeBodyc           B   s   e  Z d  Z d Z e j d d e d d Z e j d d e d d Z	 e j d d e
 j d e d e Z e j d d e Z e j d	 d e j d e d d Z d
   Z d   Z d   Z e d    Z e d    Z d   Z d   Z d   Z RS(   s>  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:

    t   challR   R.   R/   R   R   Rk   t	   validatedR   c            s6     f d   | j    D } t t    j |   d  S(   Nc            s(   i  |  ] \ } } |   j  |   q S(    (   Rr   (   R"   Rs   Rt   (   R:   (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys
   <dictcomp>  s   	 (   Ru   RO   R   RP   (   R:   R6   (    (   R:   s1   /usr/lib/python2.7/site-packages/acme/messages.pyRP     s    c         C   s   t  t |   j |  j |   S(   N(   RO   R   RA   Rr   (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRA     s    c         C   s/   t  t |   j   } | j |  j j    | S(   N(   RO   R   RR   t   updateR   (   R:   RU   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRR     s    c         C   s2   t  t |   j |  } t j j |  | d <| S(   NR   (   RO   R   t   fields_from_jsonR    t	   ChallengeRV   (   R4   RU   t   jobj_fields(    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    c         C   s   |  j  p |  j S(   s   The URL of this challenge.(   t   _urlt   _uri(   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    c         C   s   t  |  j |  S(   N(   R~   R   (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    c         c   s?   x8 t  t |   j   D]! } | d k r2 | d n | Vq Wd  S(   NR   i   (   RO   R   Ry   (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRy     s    c         C   s   | d k r d | S| S(   NR   Rz   (    (   R:   R#   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyRr     s    (   s   challN(   RF   RG   RH   R^   RI   RJ   RK   R)   R   R   R`   RV   t   STATUS_PENDINGR   R   t   RFC3339FieldR   R'   R   RP   RA   RR   RL   R   RM   R   R   Ry   Rr   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s"   					t   ChallengeResourcec           B   sD   e  Z d  Z e j d d e j Z e j d  Z e	 d    Z
 RS(   s   Challenge Resource.

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

    R   Rk   t
   authzr_uric         C   s
   |  j  j S(   s   The URL of the challenge body.(   R   R   (   R:   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    (   RF   RG   RH   RI   RJ   R   RV   R   R   RM   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   Authorizationc           B   s   e  Z d  Z e j d d e j d e Z e j d d e Z	 e j d d e Z
 e j d d e d e j Z e j d d e Z e j d d e Z e	 j d	    Z	 e d
    Z RS(   s^  Authorization Resource Body.

    :ivar acme.messages.Identifier identifier:
    :ivar list challenges: `list` of `.ChallengeBody`
    :ivar tuple combinations: Challenge combinations (`tuple` of `tuple`
        of `int`, as opposed to `list` of `list` from the spec).
    :ivar acme.messages.Status status:
    :ivar datetime.datetime expires:

    t
   identifierRk   R.   R    t   combinationsR   t   expirest   wildcardc         C   s   t  d   |  D  S(   Nc         s   s   |  ] } t  j |  Vq d  S(   N(   R   RV   (   R"   R   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>   s    (   R   (   Rl   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR      s    c            s   t    f d     j D  S(   s0   Combinations with challenges instead of indices.c         3   s+   |  ]! } t    f d    | D  Vq d S(   c         3   s   |  ] }   j  | Vq d  S(   N(   R    (   R"   t   idx(   R:   (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>%  s    N(   R   (   R"   t   combo(   R:   (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>%  s   (   R   R   (   R:   (    (   R:   s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   resolved_combinations"  s    (   RF   RG   RH   RI   RJ   Rj   RV   RK   R   R    R   R`   R   R   R   R   R   Rk   RM   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   
t   NewAuthorizationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   New authorization.s	   new-authz(   RF   RG   RH   R}   R   R   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   )  s   t   UpdateAuthorizationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   Update authorization.t   authz(   RF   RG   RH   R}   R   R   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   0  s   t   AuthorizationResourcec           B   s;   e  Z d  Z e j d d e j Z e j d d e Z	 RS(   s   Authorization Resource.

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

    R   Rk   t   new_cert_uriR.   (
   RF   RG   RH   RI   RJ   R   RV   R   RK   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   6  s   t   CertificateRequestc           B   sD   e  Z d  Z d Z e j e  Z e j d d e j	 d e j
 Z RS(   s   ACME new-cert request.

    :ivar josepy.util.ComparableX509 csr:
        `OpenSSL.crypto.X509Req` wrapped in `.ComparableX509`

    s   new-certt   csrRk   t   encoder(   RF   RG   RH   R}   R   R   R   RI   RJ   t
   decode_csrt
   encode_csrR   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   A  s   t   CertificateResourcec           B   s,   e  Z d  Z e j d  Z e j d  Z RS(   s  Certificate Resource.

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

    t   cert_chain_urit   authzrs(   RF   RG   RH   RI   RJ   R   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   N  s   t
   Revocationc           B   sS   e  Z d  Z d Z e j e  Z e j d d e j	 d e j
 Z e j d  Z RS(   s|   Revocation message.

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

    s   revoke-certt   certificateRk   R   t   reason(   RF   RG   RH   R}   R   R   R   RI   RJ   t   decode_certt   encode_certR   R   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   [  s   t   Orderc           B   s   e  Z d  Z e j d d e Z e j d d e j d e Z	 e j d d e Z
 e j d d e Z e j d d e Z e j d d e Z e j d	 d e d e j Z e j d
    Z RS(   s^  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.
    t   identifiersR.   R   Rk   t   authorizationsR   t   finalizeR   R   c         C   s   t  d   |  D  S(   Nc         s   s   |  ] } t  j |  Vq d  S(   N(   Rj   RV   (   R"   R   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pys	   <genexpr>  s    (   R   (   Rl   (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s    (   RF   RG   RH   RI   RJ   RK   R   R`   RV   R   R   R   R   R   R   R   R'   R   Rk   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR   j  s   	t   OrderResourcec           B   st   e  Z d  Z e j d d e j Z e j d d e Z	 e j d  Z
 e j d d e Z e j d d e Z RS(   s  Order Resource.

    :ivar acme.messages.Order body:
    :ivar str 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   Rk   t   csr_pemR.   R   t   fullchain_pemt   alternative_fullchains_pem(   RF   RG   RH   RI   RJ   R   RV   R   RK   R   R   R  R  (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR     s   t   NewOrderc           B   s   e  Z d  Z d Z RS(   s
   New order.s	   new-order(   RF   RG   RH   R}   (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyR    s   (A   RH   R   t   josepyRI   t   sixt   acmeR    R   R   R   R   t   acme.mixinsR   t   collections.abcR   t   ImportErrort   collectionsR%   R!   R2   t   dictRu   R8   R   R,   t   python_2_unicode_compatibleR   R'   t   JSONDeSerializableRN   R`   t   STATUS_UNKNOWNR   t   STATUS_PROCESSINGt   STATUS_VALIDt   STATUS_INVALIDt   STATUS_REVOKEDt   STATUS_READYt   STATUS_DEACTIVATEDRi   t   IDENTIFIER_FQDNRj   Rm   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  (    (    (    s1   /usr/lib/python2.7/site-packages/acme/messages.pyt   <module>   s   
			<!G		i	B"				