
\\c           @   sH  d  Z  d d l Z d d l Z y d d l m Z Wn! e k
 rU d d l m Z n Xd 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 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$ 6Z e d%   e j   D  Z e j e d&   e j   D   d'   Z e j d( e j e j f d)     Y Z d* e j e f d+     YZ d, e f d-     YZ e d.  Z e d/  Z e d0  Z e d1  Z  e d2  Z! e d3  Z" e d4  Z# d5 e f d6     YZ$ e$ d7  Z% d8 e j f d9     YZ& d: e j f d;     YZ' d< e j f d=     YZ( d> e( f d?     YZ) d@ e j f dA     YZ* dB e+ f dC     YZ, dD e* f dE     YZ- e' j. dF e- f dG     Y Z/ dH e- f dI     YZ0 dJ e) f dK     YZ1 dL e* f dM     YZ2 dN e( f dO     YZ3 dP e* f dQ     YZ4 e' j. dR e4 f dS     Y Z5 dT e) f dU     YZ6 e' j. dV e j f dW     Y Z7 dX e) f dY     YZ8 e' j. dZ e j f d[     Y Z9 d\ e* f d]     YZ: d^ e) f d_     YZ; e' j. d` e: f da     Y Z< d S(b   s   ACME protocol messages.iN(   t   Hashable(   t
   challenges(   t   errors(   t   fields(   t   util(   t   jwss   urn:acme:error:s   urn:ietf:params:acme:error:s2   The CSR is unacceptable (e.g., due to a short key)t   badCSRs1   The client sent an unacceptable anti-replay noncet   badNonces?   The server could not connect to the client to verify the domaint
   connections4   The server could not validate a DNSSEC signed domaint   dnssecs1   The provided email for a registration was invalidt   invalidEmails$   The provided contact URI was invalidt   invalidContacts!   The request message was malformedt	   malformeds,   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*   The server could not resolve a domain namet   unknownHosts,   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/dist-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/dist-packages/acme/messages.pys	   <genexpr>*   s    c         C   sB   t  |  t  r: |  j d k	 r: t |  j k p9 t |  j k St Sd 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/dist-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/dist-packages/acme/messages.pyt	   with_codeD   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/dist-packages/acme/messages.pyt   descriptionR   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   splitR$   (   R,   R'   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR'   \   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/dist-packages/acme/messages.pys	   <genexpr>l   s    (   t   joinR   R-   R#   R"   t   decode(   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __str__j   s    (   t   __name__t
   __module__t   __doc__t   joset   Fieldt   TrueR   R"   R#   t   classmethodR)   t   propertyR-   R'   R7   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   5   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   |  |  j  | <| |  _ d  S(   N(   t   POSSIBLE_NAMESR   (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __init__v   s    c         C   s   |  j  S(   N(   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   to_partial_jsonz   s    c         C   s8   | |  j  k r- t j d j |  j    n  |  j  | S(   Ns   {0} not recognized(   RA   R;   t   DeserializationErrort   formatR8   (   R&   t   value(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt	   from_json}   s    c         C   s   d j  |  j j |  j  S(   Ns   {0}({1})(   RE   t	   __class__R8   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-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/dist-packages/acme/messages.pyt   __eq__   s    c         C   s   t  |  j |  j f  S(   N(   t   hashRH   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __hash__   s    c         C   s   |  | k S(   N(    (   R,   RJ   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __ne__   s    (   s   name(   R8   R9   R:   t	   __slots__t   NotImplementedRA   RB   RC   R>   RG   RI   RK   RM   RN   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR@   q   s   					t   Statusc           B   s   e  Z d  Z i  Z RS(   s   ACME "status" field.(   R8   R9   R:   RA   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRQ      s   t   unknownt   pendingt
   processingt   validt   invalidt   revokedt   readyt   IdentifierTypec           B   s   e  Z d  Z i  Z RS(   s   ACME identifier type.(   R8   R9   R:   RA   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRY      s   t   dnst
   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   decoderRF   (	   R8   R9   R:   R;   R<   RY   RG   R   RF   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR[      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            s?   t    f d   | j   D  } t t j    j |   d  S(   Nc         3   s*   |  ]  \ } }   j  |  | f Vq d  S(   N(   t   _internal_name(   R   t   kt   v(   R,   (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>   s    (   t   dictt   itemst   superR]   R^   RB   (   R,   R(   (    (   R,   s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRB      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/dist-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(   NRh   i   (   Rg   R]   R^   t   __iter__(   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRk      s    c         C   s   | d k r d | S| S(   NRj   t   _(    (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRb      s    (   R8   R9   R:   R;   R<   R=   Rh   Ri   R`   t   caa_identitiest   external_account_requiredRB   R?   Rj   Rk   Rb   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR^      s   		c         C   s   t  | d |  S(   Nt   resource_type(   t   getattr(   R&   t   key(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt
   _canon_key   s    c         C   s/   | j  } | |  j k s t  | |  j | <| S(   s   Register resource.(   Ro   t   _REGISTERED_TYPESt   AssertionError(   R&   t   resource_body_clsRo   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   register   s    	c         C   s"   t  j | |  j  } | |  _ d  S(   N(   R   t   map_keysRr   t   _jobj(   R,   t   jobjt
   canon_jobj(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRB      s    c         C   sL   y |  | j  d d  SWn- t k
 rG } t t |  d |   n Xd  S(   NRl   t   -s   : (   t   replacet   KeyErrort   AttributeErrorR/   (   R,   R   t   error(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __getattr__   s    c         C   s<   y |  j  |  j |  SWn t k
 r7 t d   n Xd  S(   Ns   Directory field not found(   Rx   Rr   R}   (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   __getitem__   s    c         C   s   |  j  S(   N(   Rx   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRC      s    c         C   s,   |  j  j | j d i    | d <|  |  S(   Nt   meta(   R^   RG   t   pop(   R&   Ry   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRG      s    "(   R8   R9   R:   Rs   R;   t   JSONObjectWithFieldsR^   R>   Rr   Rv   RB   R   R   RC   RG   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR]      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(   R8   R9   R:   R;   R<   R   (    (    (    s1   /usr/lib/python2.7/dist-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(   R8   R9   R:   R;   R<   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR      s   t   ResourceBodyc           B   s   e  Z d  Z RS(   s   ACME Resource Body.(   R8   R9   R:   (    (    (    s1   /usr/lib/python2.7/dist-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
   newAccountRq   N(   t   jsont   dumpsRC   R3   R;   t   b64t	   b64decodeR   t   JWSt   signt   jwkt   JWKOctt   jwat   HS256R   (	   R&   t   account_public_keyt   kidt   hmac_keyt	   directoryt   key_jsont   decoded_hmac_keyt   urlt   eab(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt	   from_data  s    
(   R8   R9   R:   R>   R   (    (    (    s1   /usr/lib/python2.7/dist-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 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:

    Rq   R    R\   t   contactR!   t	   agreementt   statust   termsOfServiceAgreedt   onlyReturnExistingt   externalAccountBindings   tel:s   mailto:c         K   s   t  | j d d   } | d k	 r; | j |  j |  n  | d k	 rz | j g  | j d  D] } |  j | ^ q]  n  t |  | d <| r | | d <n  |  |   S(   s2   Create registration resource from contact details.R   t   ,t   external_account_binding(    N(	   t   listR   R   t   appendt   phone_prefixt   extendR0   t   email_prefixt   tuple(   R&   t   phonet   emailR   R(   t   detailst   mail(    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   4  s    3c            s   t    f d   |  j D  S(   Nc         3   s.   |  ]$ } | j     r | t    Vq d  S(   N(   t
   startswitht   len(   R   R#   (   t   prefix(    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>E  s    (   R   R   (   R,   R   (    (   R   s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   _filter_contactC  s    c         C   s   |  j  |  j  S(   s*   All phones found in the ``contact`` field.(   R   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   phonesH  s    c         C   s   |  j  |  j  S(   s*   All emails found in the ``contact`` field.(   R   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   emailsM  s    (    N(   R8   R9   R:   R;   R<   R=   t   JWKRG   Rq   R   R   R   t   terms_of_service_agreedt   only_return_existingR   R   R   R>   R   R   R   R?   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     s   !	t   NewRegistrationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   New registration.s   new-reg(   R8   R9   R:   Ro   R   R   t   resource(    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   S  s   t   UpdateRegistrationc           B   s#   e  Z d  Z d Z e j e  Z RS(   s   Update registration.t   reg(   R8   R9   R:   Ro   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   Z  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   R\   t   new_authzr_uriR    Rj   (   R8   R9   R:   R;   R<   R   RG   R   R=   R   Rj   (    (    (    s1   /usr/lib/python2.7/dist-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   R\   t	   validatedR   c            s<   t    f d   | j   D  } t t    j |   d  S(   Nc         3   s*   |  ]  \ } }   j  |  | f Vq d  S(   N(   Rb   (   R   Rc   Rd   (   R,   (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>  s    (   Re   Rf   Rg   R   RB   (   R,   R(   (    (   R,   s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRB     s    "c         C   s   t  t |   j |  j |   S(   N(   Rg   R   R3   Rb   (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR3     s    c         C   s/   t  t |   j   } | j |  j j    | S(   N(   Rg   R   RC   t   updateR   (   R,   Ry   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRC     s    c         C   s2   t  t |   j |  } t j j |  | d <| S(   NR   (   Rg   R   t   fields_from_jsonR   t	   ChallengeRG   (   R&   Ry   t   jobj_fields(    (    s1   /usr/lib/python2.7/dist-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/dist-packages/acme/messages.pyR     s    c         C   s   t  |  j |  S(   N(   Rp   R   (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     s    c         c   s?   x8 t  t |   j   D]! } | d k r2 | d n | Vq Wd  S(   NR   i   (   Rg   R   Rk   (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRk     s    c         C   s   | d k r d | S| S(   NR   Rl   (    (   R,   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyRb     s    (   s   challN(   R8   R9   R:   RO   R;   R<   R=   R   R   R   RQ   RG   t   STATUS_PENDINGR   R   t   RFC3339FieldR   R   R   RB   R3   RC   R>   R   R?   R   R   Rk   Rb   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   m  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   R\   t
   authzr_uric         C   s
   |  j  j S(   s   The URL of the challenge body.(   R   R   (   R,   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     s    (   R8   R9   R:   R;   R<   R   RG   R   R   R?   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     s   t   Authorizationc           B   s   e  Z d  Z e j d d e j 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
   identifierR\   R   R    t   combinationsR   t   expirest   wildcardc         C   s   t  d   |  D  S(   Nc         s   s   |  ] } t  j |  Vq d  S(   N(   R   RG   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>  s    (   R   (   RF   (    (    s1   /usr/lib/python2.7/dist-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/dist-packages/acme/messages.pys	   <genexpr>  s    N(   R   (   R   t   combo(   R,   (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>  s   (   R   R   (   R,   (    (   R,   s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   resolved_combinations  s    (   R8   R9   R:   R;   R<   R[   RG   R   R=   R   R   RQ   R   R   R   R   R   R\   R?   R   (    (    (    s1   /usr/lib/python2.7/dist-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(   R8   R9   R:   Ro   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     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   R\   t   new_cert_uriR    (
   R8   R9   R:   R;   R<   R   RG   R   R=   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     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   csrR\   t   encoder(   R8   R9   R:   Ro   R   R   R   R;   R<   t
   decode_csrt
   encode_csrR   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     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(   R8   R9   R:   R;   R<   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     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   certificateR\   R   t   reason(   R8   R9   R:   Ro   R   R   R   R;   R<   t   decode_certt   encode_certR   R   (    (    (    s1   /usr/lib/python2.7/dist-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 list of .Identifier: List of identifiers for the certificate.
    :ivar acme.messages.Status status:
    :ivar list of str authorizations: URLs of authorizations.
    :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   R\   t   authorizationsR   t   finalizeR   R   c         C   s   t  d   |  D  S(   Nc         s   s   |  ] } t  j |  Vq d  S(   N(   R[   RG   (   R   R   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pys	   <genexpr>5  s    (   R   (   RF   (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   3  s    (   R8   R9   R:   R;   R<   R=   R   RQ   RG   R   R   R   R   R   R   R   R   R   R\   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR     s   	t   OrderResourcec           B   s_   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 RS(   s  Order Resource.

    :ivar acme.messages.Order body:
    :ivar str csr_pem: The CSR this Order will be finalized with.
    :ivar list of acme.messages.AuthorizationResource authorizations:
        Fully-fetched AuthorizationResource objects.
    :ivar str fullchain_pem: The fetched contents of the certificate URL
        produced once the order was finalized, if it's present.
    R   R\   t   csr_pemR    R   t   fullchain_pem(   R8   R9   R:   R;   R<   R   RG   R   R=   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   7  s
   	t   NewOrderc           B   s   e  Z d  Z d Z RS(   s
   New order.s	   new-order(   R8   R9   R:   Ro   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyR   F  s   (=   R:   t   sixR   t   collections.abcR    t   ImportErrort   collectionst   josepyR;   t   acmeR   R   R   R   R   R   R   R$   Re   Rf   R*   R   R   t   python_2_unicode_compatibleR   R   t   JSONDeSerializableR@   RQ   t   STATUS_UNKNOWNR   t   STATUS_PROCESSINGt   STATUS_VALIDt   STATUS_INVALIDt   STATUS_REVOKEDt   STATUS_READYRY   t   IDENTIFIER_FQDNR[   R]   R   R   R   t   objectR   R   Rv   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s1   /usr/lib/python2.7/dist-packages/acme/messages.pyt   <module>   s   
			; H		5	C"				