
l]]c           @` s  d  Z  d d l m Z m Z m Z m Z d d l m Z d d l m	 Z	 d d l
 Z
 d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z d d	 l m Z d d
 l m Z m Z m Z d d l m Z m Z m Z m Z d d l  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. m/ Z/ m0 Z0 m1 Z1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< d d l= m> Z> d d l? m@ Z@ mA ZA mB ZB mC ZC d e* f d     YZD d e* f d     YZE d e* f d     YZF d e0 f d     YZG d e3 f d     YZH d e4 f d     YZI d e" f d     YZJ d e3 f d     YZK d e7 f d      YZL e d!    ZM d" e% f d#     YZN d$ e. f d%     YZO d& e3 f d'     YZP d( e6 f d)     YZQ d* e4 f d+     YZR d, e% f d-     YZS d. e3 f d/     YZT d0 e% f d1     YZU d2 e% f d3     YZV d4 e% f d5     YZW d6 e5 f d7     YZX d8 e5 f d9     YZY d: e4 f d;     YZZ d< e4 f d=     YZ[ d> e3 f d?     YZ\ d@ e3 f dA     YZ] dB e4 f dC     YZ^ dD e3 f dE     YZ_ dF e4 f dG     YZ` dH e% f dI     YZa dJ e% f dK     YZb dL e5 f dM     YZc dN e4 f dO     YZd dP e5 f dQ     YZe dR e3 f dS     YZf dT e6 f dU     YZg dV e3 f dW     YZh dX e% f dY     YZi dZ e+ f d[     YZj d\ e+ f d]     YZk d^ e3 f d_     YZl d` e4 f da     YZm db e3 f dc     YZn dd e3 f de     YZo df e% f dg     YZp dh e4 f di     YZq dj e% f dk     YZr dl e3 f dm     YZs dn e3 f do     YZt dp e3 f dq     YZu dr e% f ds     YZv dt e" f du     YZw dv e3 f dw     YZx dx e4 f dy     YZy dz e3 f d{     YZz d| e3 f d}     YZ{ d~ e4 f d     YZ| d e% f d     YZ} d e4 f d     YZ~ d e3 f d     YZ d e3 f d     YZ d e. f d     YZ d e3 f d     YZ d e4 f d     YZ d e. f d     YZ d e3 f d     YZ d e4 f d     YZ d e3 f d     YZ d e4 f d     YZ d e3 f d     YZ d e. f d     YZ d e4 f d     YZ d e. f d     YZ d e3 f d     YZ d e4 f d     YZ d e4 f d     YZ d e4 f d     YZ d e3 f d     YZ d e" f d     YZ d e+ f d     YZ d e3 f d     YZ d e6 f d     YZ d e3 f d     YZ d e3 f d     YZ d e6 f d     YZ d e' f d     YZ d e' f d     YZ d e' f d     YZ d e' f d     YZ d e' f d     YZ d e' f d     YZ d e3 f d     YZ d e3 f d     YZ d e' f d     YZ d e3 f d     YZ d e3 f d     YZ d e6 f d     YZ d e. f d     YZ d e6 f d     YZ d e6 f d     YZ d e6 f d     YZ d e3 f d     YZ d e6 f d     YZ d e3 f d     YZ d e4 f d     YZ d e. f d     YZ d e3 f d     YZ d e4 f d     YZ d e3 f d     YZ d e3 f d     YZ d e4 f d     YZ d e4 f d     YZ d e3 f d     YZ d e& f d     YZ d S(   u   
ASN.1 type classes for X.509 certificates. Exports the following items:

 - Attributes()
 - Certificate()
 - Extensions()
 - GeneralName()
 - GeneralNames()
 - Name()

Other type classes are defined that help compose the types listed above.
i    (   t   unicode_literalst   divisiont   absolute_importt   print_function(   t   contextmanager(   t   idnaNi   (   t   unwrap(   t
   iri_to_urit
   uri_to_iri(   t   OrderedDict(   t	   type_namet   str_clst   bytes_to_list(   t   AlgorithmIdentifiert   AnyAlgorithmIdentifiert   DigestAlgorithmt   SignedDigestAlgorithm(   t   Anyt	   BitStringt	   BMPStringt   Booleant   Choicet   Concatt
   Enumeratedt   GeneralizedTimet   GeneralStringt	   IA5Stringt   Integert   Nullt   NumericStringt   ObjectIdentifiert   OctetBitStringt   OctetStringt   ParsableOctetStringt   PrintableStringt   Sequencet
   SequenceOft   Sett   SetOft   TeletexStringt   UniversalStringt   UTCTimet
   UTF8Stringt   VisibleStringt   VOID(   t   PublicKeyInfo(   t   int_to_bytest   int_from_bytest	   inet_ntopt	   inet_ptont   DNSNamec           B` s/   e  Z d  Z d Z d   Z d   Z d   Z RS(   u   idnai   i   c         C` s   |  | k S(   N(    (   t   selft   other(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   __ne__L   s    c         C` s5   t  | t  s t S|  j   j   | j   j   k S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.2

        :param other:
            Another DNSName object

        :return:
            A boolean
        (   t
   isinstanceR2   t   Falset   __unicode__t   lower(   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   __eq__O   s    c         C` s   t  | t  s6 t t d t |   t |     n  | j d  rb d | d j |  j  } n | j |  j  } | |  _ | |  _	 d |  _ |  j d k r d |  _ n  d S(   ud   
        Sets the value of the DNS name

        :param value:
            A unicode string
        uK   
                %s value must be a unicode string, not %s
                u   .t   .i   t    N(   R6   R   t	   TypeErrorR   R
   t
   startswitht   encodet	   _encodingt   _unicodet   contentst   Nonet   _headert   _trailer(   R3   t   valuet   encoded_value(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   set_   s    				(   i   i   (   t   __name__t
   __module__R@   t   _bad_tagR5   R:   RH   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR2   G   s
   		t   URIc           B` s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C` sv   t  | t  s6 t t d t |   t |     n  | |  _ t |  |  _ d |  _	 |  j
 d k rr d |  _
 n  d S(   ub   
        Sets the value of the string

        :param value:
            A unicode string
        uK   
                %s value must be a unicode string, not %s
                R<   N(   R6   R   R=   R   R
   RA   R   RB   RC   RD   RE   (   R3   RF   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRH   ~   s    			c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5      s    c         C` s5   t  | t  s t St |  j t  t | j t  k S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.4

        :param other:
            Another URI object

        :return:
            A boolean
        (   R6   RL   R7   R   t   nativet   True(   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:      s    c         C` sA   |  j  d k r d S|  j d k r: t |  j    |  _ n  |  j S(   u7   
        :return:
            A unicode string
        u    N(   RB   RC   RA   R   t   _merge_chunks(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR8      s
    (   RI   RJ   RH   R5   R:   R8   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRL   |   s   			t   EmailAddressc           B` s_   e  Z d Z e Z d	 Z e d    Z e j	 d    Z d   Z
 d   Z d   Z d   Z RS(
   i   i   c         C` s   |  j  S(   u`   
        :return:
            A byte string of the DER-encoded contents of the sequence
        (   t	   _contents(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRB      s    c         C` s   t  |  _ | |  _ d S(   ue   
        :param value:
            A byte string of the DER-encoded contents of the sequence
        N(   R7   t   _normalizedRQ   (   R3   RF   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRB      s    	c         C` s   t  | t  s6 t t d t |   t |     n  | j d  d k r | j d d  \ } } | j d  d | j d  } n | j d  } t |  _	 | |  _
 | |  _ d	 |  _ |  j d k r d |  _ n  d	 S(
   ub   
        Sets the value of the string

        :param value:
            A unicode string
        uK   
                %s value must be a unicode string, not %s
                u   @ii   u   asciit   @u   idnaR<   N(   R6   R   R=   R   R
   t   findt   rsplitR?   RN   RR   RA   RB   RC   RD   RE   (   R3   RF   t   mailboxt   hostnameRG   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRH      s    	#				c         C` s   |  j  d k r |  j   } | j d  d k rE | j d  |  _  q | j d d  \ } } | j d  d | j d  |  _  n  |  j  S(   u7   
        :return:
            A unicode string
        RS   iu   cp1252i   u   @u   idnaN(   RA   RC   RO   RT   t   decodeRU   (   R3   RB   RV   RW   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR8      s    &c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` s   t  | t  s t S|  j s/ |  j |  j  n  | j sK | j | j  n  |  j j d  d k s{ | j j d  d k r |  j | j k S| j j d d  \ } } |  j j d d  \ } } | | k r t S| j	   | j	   k r t St
 S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.5

        :param other:
            Another EmailAddress object

        :return:
            A boolean
        RS   ii   (   R6   RP   R7   RR   RH   RM   RQ   RT   RU   R9   RN   (   R3   R4   t   other_mailboxt   other_hostnameRV   RW   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s    		0N(   i   i   (   RI   RJ   RC   RQ   R7   RR   RK   t   propertyRB   t   setterRH   R8   R5   R:   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRP      s   	
			t	   IPAddressc           B` sA   e  Z d d d   Z d   Z e d    Z d   Z d   Z RS(   c         C` s   t  t d    d S(   u?   
        This method is not applicable to IP addresses
        u=   
            IP address values can not be parsed
            N(   t
   ValueErrorR   (   R3   t   spect   spec_params(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   parse'  s    c   
      C` s  t  | t  s6 t t d t |   t |     n  | } | j d  d k } d } | r | j d d  } | d } t | d  } | d k  r t t d t |      q n  | j d  d k rt	 j
 } | d k r t t d	 t |      n  d } n9 t	 j } | d
 k r:t t d t |      n  d
 } d } | rd | }	 |	 d | t |	  7}	 t t |	 d   } d | d t |  | } n  | |  _ t | |  | |  _ |  j |  _ d |  _ |  j d k rd |  _ n  d S(   u   
        Sets the value of the object

        :param value:
            A unicode string containing an IPv4 address, IPv4 address with CIDR,
            an IPv6 address or IPv6 address with CIDR
        uK   
                %s value must be a unicode string, not %s
                u   /ii    i   uT   
                    %s value contains a CIDR range less than 0
                    u   :i   u   
                    %s value contains a CIDR range bigger than 128, the maximum
                    value for an IPv6 address
                    i    u   
                    %s value contains a CIDR range bigger than 32, the maximum
                    value for an IPv4 address
                    R<   u   1u   0i   s    i   N(   R6   R   R=   R   R
   RT   t   splitt   intR^   t   sockett   AF_INET6t   AF_INETt   lenR.   t   _nativeR1   RB   t   _bytesRC   RD   RE   (
   R3   RF   t   original_valuet   has_cidrt   cidrt   partst   familyt	   cidr_sizet
   cidr_bytest	   cidr_mask(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRH   2  sR    		
			
		c         C` sF  |  j  d	 k r d	 S|  j d	 k r?|  j   } t |  } d	 } d	 } | t d d g  k r t t j | d d ! } | d k r t	 | d  } q nS | t d d g  k r t t j
 | d d ! } | d k r t	 | d  } q n  | d	 k	 r3d j |  } t | j d   } | d t |  } n  | |  _ n  |  j S(
   u   
        The native Python datatype representation of this value

        :return:
            A unicode string or None
        i    i   i    i   i   u   {0:b}u   0u   /N(   RB   RC   Rh   t	   __bytes__Rg   RH   R0   Rd   Re   R/   Rf   t   formatt   rstripR   (   R3   t   byte_stringt   byte_lenRF   t   cidr_intt	   cidr_bitsRl   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRM   y  s*    	c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` s)   t  | t  s t S|  j   | j   k S(   ul   
        :param other:
            Another IPAddress object

        :return:
            A boolean
        (   R6   R]   R7   Rr   (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s    	N(	   RI   RJ   RC   Ra   RH   R[   RM   R5   R:   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR]   &  s
   	G 	t	   Attributec           B` s*   e  Z d  e f d e i e d 6f g Z RS(   u   typeu   valuesu   spec(   RI   RJ   R   R&   R   t   _fields(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRy     s   	t
   Attributesc           B` s   e  Z e Z RS(    (   RI   RJ   Ry   t   _child_spec(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR{     s   t   KeyUsagec           B` sM   e  Z i	 d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6d d 6Z RS(   u   digital_signaturei    u   non_repudiationi   u   key_enciphermenti   u   data_enciphermenti   u   key_agreementi   u   key_cert_signi   u   crl_signi   u   encipher_onlyi   u   decipher_onlyi   (   RI   RJ   t   _map(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR}     s   t   PrivateKeyUsagePeriodc           B` sB   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f g Z RS(   u
   not_beforei    u   implicitu   optionalu	   not_afteri   (   RI   RJ   R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   NotReallyTeletexStringc           B` s   e  Z d  Z d Z d   Z RS(   u6  
    OpenSSL (and probably some other libraries) puts ISO-8859-1
    into TeletexString instead of ITU T.61. We use Windows-1252 when
    decoding since it is a superset of ISO-8859-1, and less likely to
    cause encoding issues, but we stay strict with encoding to prevent
    us from creating bad data.
    u   cp1252c         C` sG   |  j  d k r d S|  j d k r@ |  j   j |  j  |  _ n  |  j S(   u7   
        :return:
            A unicode string
        u    N(   RB   RC   RA   RO   RX   t   _decoding_encoding(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR8     s
    (   RI   RJ   t   __doc__R   R8   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   c           c` s#   z d t  _ d  VWd  d t  _ Xd  S(   Nu   teletexu   cp1252(   R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   strict_teletex  s    		t   DirectoryStringc           B` sD   e  Z d  e f d e f d e f d e f d e f d e f g Z RS(   u   teletex_stringu   printable_stringu   universal_stringu   utf8_stringu
   bmp_stringu
   ia5_string(	   RI   RJ   R   R"   R(   R*   R   R   t   _alternatives(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   					t   NameTypec            B` sy  e  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# 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? 6d@ dA 6Z d< d: d8 d d d d d
 d d d d d d  d d  d d d d& d$ d d6 d> d@ d( d* d, d. d0 d2 d4 g  Z e dB    Z e dC    Z RS(D   u   common_nameu   2.5.4.3u   surnameu   2.5.4.4u   serial_numberu   2.5.4.5u   country_nameu   2.5.4.6u   locality_nameu   2.5.4.7u   state_or_province_nameu   2.5.4.8u   street_addressu   2.5.4.9u   organization_nameu   2.5.4.10u   organizational_unit_nameu   2.5.4.11u   titleu   2.5.4.12u   business_categoryu   2.5.4.15u   postal_codeu   2.5.4.17u   telephone_numberu   2.5.4.20u   nameu   2.5.4.41u
   given_nameu   2.5.4.42u   initialsu   2.5.4.43u   generation_qualifieru   2.5.4.44u   unique_identifieru   2.5.4.45u   dn_qualifieru   2.5.4.46u	   pseudonymu   2.5.4.65u   organization_identifieru   2.5.4.97u   tpm_manufactureru   2.23.133.2.1u	   tpm_modelu   2.23.133.2.2u   tpm_versionu   2.23.133.2.3u   platform_manufactureru   2.23.133.2.4u   platform_modelu   2.23.133.2.5u   platform_versionu   2.23.133.2.6u   email_addressu   1.2.840.113549.1.9.1u   incorporation_localityu   1.3.6.1.4.1.311.60.2.1.1u   incorporation_state_or_provinceu   1.3.6.1.4.1.311.60.2.1.2u   incorporation_countryu   1.3.6.1.4.1.311.60.2.1.3u   domain_componentu   0.9.2342.19200300.100.1.25u   name_distinguisheru   0.2.262.1.10.7.20c         C` sL   |  j  |  } | |  j k r3 |  j j |  } n t |  j  } | | f S(   u   
        Returns an ordering value for a particular attribute key.

        Unrecognized attributes and OIDs will be sorted lexically at the end.

        :return:
            An orderable value.

        (   t   mapt   preferred_ordert   indexRg   (   t   clst	   attr_namet   ordinal(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   preferred_ordinalH  s
    c         C` s   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$ 6d% d& 6d' d( 6d) d* 6d+ d, 6d- d. 6d/ d0 6d1 d2 6d3 d4 6d5 d6 6d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6j  |  j |  j  S(C   uZ   
        :return:
            A human-friendly unicode string to display to users
        u   Common Nameu   common_nameu   Surnameu   surnameu   Serial Numberu   serial_numberu   Countryu   country_nameu   Localityu   locality_nameu   State/Provinceu   state_or_province_nameu   Street Addressu   street_addressu   Organizationu   organization_nameu   Organizational Unitu   organizational_unit_nameu   Titleu   titleu   Business Categoryu   business_categoryu   Postal Codeu   postal_codeu   Telephone Numberu   telephone_numberu   Nameu   nameu
   Given Nameu
   given_nameu   Initialsu   initialsu   Generation Qualifieru   generation_qualifieru   Unique Identifieru   unique_identifieru   DN Qualifieru   dn_qualifieru	   Pseudonymu	   pseudonymu   Email Addressu   email_addressu   Incorporation Localityu   incorporation_localityu   Incorporation State/Provinceu   incorporation_state_or_provinceu   Incorporation Countryu   incorporation_countryu   Domain Componentu   domain_componentu   Name Distinguisheru   name_distinguisheru   Organization Identifieru   organization_identifieru   TPM Manufactureru   tpm_manufactureru	   TPM Modelu	   tpm_modelu   TPM Versionu   tpm_versionu   Platform Manufactureru   platform_manufactureru   Platform Modelu   platform_modelu   Platform Versionu   platform_version(   t   getRM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   human_friendly\  sF    
(   RI   RJ   R~   R   t   classmethodR   R[   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   
	t   NameTypeAndValuec           B` sC  e  Z d  e f d e f g Z d' Z i! e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d	 6e d
 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e	 d 6e d 6e d 6e d 6e
 d 6e d 6e d 6e d 6e d 6e d 6e d  6e d! 6e d" 6Z d( Z e d#    Z d$   Z d%   Z d&   Z RS()   u   typeu   valueu   common_nameu   surnameu   serial_numberu   country_nameu   locality_nameu   state_or_province_nameu   street_addressu   organization_nameu   organizational_unit_nameu   titleu   business_categoryu   postal_codeu   telephone_numberu   nameu
   given_nameu   initialsu   generation_qualifieru   unique_identifieru   dn_qualifieru	   pseudonymu   email_addressu   incorporation_localityu   incorporation_state_or_provinceu   incorporation_countryu   domain_componentu   name_distinguisheru   organization_identifieru   tpm_manufactureru	   tpm_modelu   tpm_versionu   platform_manufactureru   platform_modelu   platform_versionc         C` s2   |  j  d k r+ |  j |  d j  |  _  n  |  j  S(   u   
        Returns the value after being processed by the internationalized string
        preparation as specified by RFC 5280

        :return:
            A unicode string
        u   valueN(   t   _preppedRC   t   _ldap_string_prepRM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   prepped_value  s    
c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` sA   t  | t  s t S| d j |  d j k r1 t S| j |  j k S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1

        :param other:
            Another NameTypeAndValue object

        :return:
            A boolean
        u   type(   R6   R   R7   RM   R   (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s
    c         C` s  t  j d d |  } t  j d d |  } t j d k rQ t  j d d |  } n t  j d d |  } t  j d d |  } | j d	 d  } t  j d
 d |  } d j t t j |   } t	 j
 d |  } x | D] } t j |  r t t d    n  t j |  r$t t d    n  t j |  rHt t d    n  t j |  rlt t d    n  t j |  rt t d    n  | d k r t t d    q q Wt } t } x> | D]6 } t j |  rt } qt j |  rt } qqW| rZt j | d  } t j | d  } | sB| sB| rZt t d    qZn  d t  j d d |  j   d } | S(   u"  
        Implements the internationalized string preparation algorithm from
        RFC 4518. https://tools.ietf.org/html/rfc4518#section-2

        :param string:
            A unicode string to prepare

        :return:
            A prepared unicode string, ready for comparison
        u   [­᠆͏᠋-᠍️-＀￼]+u    u	   [	
]u    i  u   [-]|[-]|󠀁u   [𝅳-𝅺󠀠-󠁿󠀁]u?   [ ----۝܏᠎‌-‏‪-‮⁠-⁣⁪-⁯﻿￹-￻]+u   ​u   [   -  -   　]u   NFKCuc   
                    X.509 Name objects may not contain unassigned code points
                    u   
                    X.509 Name objects may not contain change display or
                    zzzzdeprecated characters
                    uc   
                    X.509 Name objects may not contain private use characters
                    uf   
                    X.509 Name objects may not contain non-character code points
                    ub   
                    X.509 Name objects may not contain surrogate code points
                    u   �uf   
                    X.509 Name objects may not contain the replacement character
                    i    iu{   
                    X.509 Name object contains a malformed bidirectional
                    sequence
                    u    +u     (   t   ret   subt   syst
   maxunicodet   replacet   joinR   t
   stringprept   map_table_b2t   unicodedatat	   normalizet   in_table_a1R^   R   t   in_table_c8t   in_table_c3t   in_table_c4t   in_table_c5R7   t   in_table_d1RN   t   in_table_d2t   strip(   R3   t   stringt   chart   has_r_and_al_catt	   has_l_catt   first_is_r_and_alt   last_is_r_and_al(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s^    		#(   u   typeu   valueN(   RI   RJ   R   R   Rz   t	   _oid_pairR   R"   R   RP   R2   R*   t
   _oid_specsRC   R   R[   R   R5   R:   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     sT   	
		t   RelativeDistinguishedNamec           B` sA   e  Z e Z e d     Z d   Z d   Z d   Z d   Z	 RS(   c         C` sZ   g  } |  j  |   } x5 t | j    D]! } | j d | | | f  q( Wd j |  S(   ub   
        :return:
            A unicode string that can be used as a dict key or in a set
        u   %s: %su   (   t   _get_valuest   sortedt   keyst   appendR   (   R3   t   outputt   valuest   key(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   hashableK  s
    c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5   [  s    c         C` s   t  | t  s t St |   t |  k r/ t S|  j |   } |  j |  } | | k r] t S|  j |   } |  j |  } x& | D] } | | | | k r t Sq Wt S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1

        :param other:
            Another RelativeDistinguishedName object

        :return:
            A boolean
        (   R6   R   R7   Rg   t
   _get_typesR   RN   (   R3   R4   t
   self_typest   other_typest   self_valuest   other_valuest
   type_name_(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:   ^  s    c         C` s$   t  g  | D] } | d j ^ q
  S(   u   
        Returns a set of types contained in an RDN

        :param rdn:
            A RelativeDistinguishedName object

        :return:
            A set object with unicode strings of NameTypeAndValue type field
            values
        u   type(   RH   RM   (   R3   t   rdnt   ntv(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   ~  s    c         C` s=   i  } g  | D]( } | j  | d j | j f g  ^ q | S(   u$  
        Returns a dict of prepped values contained in an RDN

        :param rdn:
            A RelativeDistinguishedName object

        :return:
            A dict object with unicode strings of NameTypeAndValue value field
            values that have been prepped for comparison
        u   type(   t   updateRM   R   (   R3   R   R   R   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s    3(
   RI   RJ   R   R|   R[   R   R5   R:   R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   H  s   		 	t   RDNSequencec           B` s/   e  Z e Z e d     Z d   Z d   Z RS(   c         C` s   d j  d   |  D  S(   ub   
        :return:
            A unicode string that can be used as a dict key or in a set
        u   c         s` s   |  ] } | j  Vq d  S(   N(   R   (   t   .0R   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pys	   <genexpr>  s    (   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s    
c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` sd   t  | t  s t St |   t |  k r/ t Sx. t |   D]  \ } } | | | k r< t Sq< Wt S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1

        :param other:
            Another RDNSequence object

        :return:
            A boolean
        (   R6   R   R7   Rg   t	   enumerateRN   (   R3   R4   R   t   self_rdn(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s    (   RI   RJ   R   R|   R[   R   R5   R:   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   Namec           B` s   e  Z d  e f g Z d Z d Z d Z e e	 d   Z
 e d    Z d   Z d   Z d   Z e d    Z e d    Z d   Z e d	    Z e d
    Z RS(   u    c   	      C` sA  g  } | s d } t  } n d } t } t t | j   d d    } x | j   D] \ } } t j |  } | d k r t |  } no | d k r t |  } nT | t	 d d d	 g  k r t
 d
 d d t |   } n t
 d
 | d | |   } | j t t i | d 6| d 6 g   qU W|  d
 d d t |   S(   uT  
        Creates a Name object from a dict of unicode string keys and values.
        The keys should be from NameType._map, or a dotted-integer OID unicode
        string.

        :param name_dict:
            A dict of name information, e.g. {"common_name": "Will Bond",
            "country_name": "US", "organization": "Codex Non Sufficit LC"}

        :param use_printable:
            A bool - if PrintableString should be used for encoding instead of
            UTF8String. This is for backwards compatibility with old software.

        :return:
            An x509.Name object
        u   utf8_stringu   printable_stringR   c         S` s   t  j |  d  S(   Ni    (   R   R   (   t   item(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   <lambda>  R<   u   email_addressu   domain_componentu   dn_qualifieru   country_nameu   serial_numbert   nameRF   u   typeu   valueu    (   R*   R"   R	   R   t   itemsR   R   RP   R2   RH   R   R   R   R   R   (	   R   t	   name_dictt   use_printablet   rdnst   encoding_namet   encoding_classt   attribute_namet   attribute_valueRF   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   build  s8    		c         C` s
   |  j  j S(   ub   
        :return:
            A unicode string that can be used as a dict key or in a set
        (   t   chosenR   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s    c         C` s   t  |  j  S(   N(   Rg   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   __len__  s    c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` s#   t  | t  s t S|  j | j k S(   u   
        Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1

        :param other:
            Another Name object

        :return:
            A boolean
        (   R6   R   R7   R   (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s    c         C` s   |  j  d  k r t   |  _  x |  j j D] } x | D]w } | d } | |  j  k r |  j  | } t | t  s | g } |  j  | <n  | j | d  q5 | d |  j  | <q5 Wq( Wn  |  j  S(   Nu   typeu   value(   Rh   RC   R	   R   RM   R6   t   listR   (   R3   R   t   type_valt
   field_namet   existing(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRM   +  s    
c         C` s~  |  j  d	 k rwt   } d	 } xx |  j D]m } xd | D]\ } | d j } | } | | k r | | g | | <| | j | d  q5 | d | | <q5 Wq( Wg  } | j   } | d k r t t |   } n  x> | D]6 } | | }	 |  j	 |	  }
 | j d | |
 f  q Wt
 } x- | D]% } | j d  d k rt } PqqW| sOd n d } | j | d	 d	 d   |  _  n  |  j  S(
   ug   
        :return:
            A human-friendly unicode string containing the parts of the name
        u   typeu   valueu   Countryu   %s: %su   ,iu   , u   ; N(   t   _human_friendlyRC   R	   R   R   R   R   t   reversedR   t   _recursive_humanizeR7   RT   RN   R   (   R3   t   datat
   last_fieldR   R   R   t   to_joinR   R   RF   t   native_valuet	   has_commat   elementt	   separator(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   ;  s6    	
"c         C` sE   t  | t  r> d j t g  | D] } |  j |  ^ q   S| j S(   u   
        Recursively serializes data compiled from the RDNSequence

        :param value:
            An Asn1Value object, or a list of Asn1Value objects

        :return:
            A unicode string
        u   , (   R6   R   R   R   R   RM   (   R3   RF   t	   sub_value(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   b  s    )c         C` s7   |  j  d k r0 t j |  j    j   |  _  n  |  j  S(   uZ   
        :return:
            The SHA1 hash of the DER-encoded bytes of this name
        N(   t   _sha1RC   t   hashlibt   sha1t   dumpt   digest(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   s  s    !c         C` s7   |  j  d k r0 t j |  j    j   |  _  n  |  j  S(   u]   
        :return:
            The SHA-256 hash of the DER-encoded bytes of this name
        N(   t   _sha256RC   R   t   sha256R   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   ~  s    !N(   RI   RJ   R   R   RC   R   R   R   R   R7   R   R[   R   R   R5   R:   RM   R   R   R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   <				'	t   AnotherNamec           B` s*   e  Z d  e f d e i d d 6f g Z RS(   u   type_idu   valuei    u   explicit(   RI   RJ   R   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   CountryNamec           B` s,   e  Z d  Z d  Z d e f d e f g Z RS(   i   u   x121_dcc_codeu   iso_3166_alpha2_code(   RI   RJ   t   class_t   tagR   R"   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   AdministrationDomainNamec           B` s,   e  Z d  Z d Z d e f d e f g Z RS(   i   i   u   numericu	   printable(   RI   RJ   R   R   R   R"   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   PrivateDomainNamec           B` s    e  Z d  e f d e f g Z RS(   u   numericu	   printable(   RI   RJ   R   R"   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   PersonalNamec           B` so   e  Z d  e i d d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e i d	 d 6e d 6f g Z RS(
   u   surnamei    u   implicitu
   given_namei   u   optionalu   initialsi   u   generation_qualifieri   (   RI   RJ   R"   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   TeletexPersonalNamec           B` so   e  Z d  e i d d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e i d	 d 6e d 6f g Z RS(
   u   surnamei    u   implicitu
   given_namei   u   optionalu   initialsi   u   generation_qualifieri   (   RI   RJ   R'   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   OrganizationalUnitNamesc           B` s   e  Z e Z RS(    (   RI   RJ   R"   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   TeletexOrganizationalUnitNamesc           B` s   e  Z e Z RS(    (   RI   RJ   R'   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   BuiltInStandardAttributesc           B` s   e  Z d  e i e d 6f d e i e d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e i d	 d
 6e d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e	 i d d 6e d 6f g	 Z
 RS(   u   country_nameu   optionalu   administration_domain_nameu   network_addressi    u   implicitu   terminal_identifieri   u   private_domain_namei   u   explicitu   organization_namei   u   numeric_user_identifieri   u   personal_namei   u   organizational_unit_namesi   (   RI   RJ   R   RN   R   R   R"   R   R   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   BuiltInDomainDefinedAttributec           B` s    e  Z d  e f d e f g Z RS(   u   typeu   value(   RI   RJ   R"   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   BuiltInDomainDefinedAttributesc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   TeletexDomainDefinedAttributec           B` s    e  Z d  e f d e f g Z RS(   u   typeu   value(   RI   RJ   R'   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   TeletexDomainDefinedAttributesc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   PhysicalDeliveryCountryNamec           B` s    e  Z d  e f d e f g Z RS(   u   x121_dcc_codeu   iso_3166_alpha2_code(   RI   RJ   R   R"   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t
   PostalCodec           B` s    e  Z d  e f d e f g Z RS(   u   numeric_codeu   printable_code(   RI   RJ   R   R"   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   	t   PDSParameterc           B` s4   e  Z d  e i e d 6f d e i e d 6f g Z RS(   u   printable_stringu   optionalu   teletex_string(   RI   RJ   R"   RN   R'   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   PrintableAddressc           B` s   e  Z e Z RS(    (   RI   RJ   R"   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   UnformattedPostalAddressc           B` s4   e  Z d  e i e d 6f d e i e d 6f g Z RS(   u   printable_addressu   optionalu   teletex_string(   RI   RJ   R   RN   R'   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   E1634Addressc           B` s;   e  Z d  e i d d 6f d e i d d 6e d 6f g Z RS(   u   numberi    u   implicitu   sub_addressi   u   optional(   RI   RJ   R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   
  s   t
   NAddressesc           B` s   e  Z e Z RS(    (   RI   RJ   R    R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   PresentationAddressc           B` so   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f d e i d d 6e d 6f d e i d	 d 6f g Z RS(
   u
   p_selectori    u   explicitu   optionalu
   s_selectori   u
   t_selectori   u   n_addressesi   (   RI   RJ   R    RN   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s   t   ExtendedNetworkAddressc           B` s*   e  Z d  e f d e i d d 6f g Z RS(   u   e163_4_addressu   psap_addressi    u   implicit(   RI   RJ   R   R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   	t   TerminalTypec           B` s8   e  Z i d  d 6d d 6d d 6d d 6d d	 6d
 d 6Z RS(   u   telexi   u   teletexi   u   g3_facsimilei   u   g4_facsimilei   u   ia5_terminali   u   videotexi   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  %  s   t   ExtensionAttributeTypec           B` s   e  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# 6d$ d% 6d& d' 6d( d) 6d* d+ 6d, d- 6Z RS(.   u   common_namei   u   teletex_common_namei   u   teletex_organization_namei   u   teletex_personal_namei   u   teletex_organization_unit_namesi   u!   teletex_domain_defined_attributesi   u   pds_namei   u   physical_delivery_country_namei   u   postal_codei	   u   physical_delivery_office_namei
   u   physical_delivery_office_numberi   u   extension_of_address_componentsi   u   physical_delivery_personal_namei   u#   physical_delivery_organization_namei   u.   extension_physical_delivery_address_componentsi   u   unformatted_postal_addressi   u   street_addressi   u   post_office_box_addressi   u   poste_restante_addressi   u   unique_postal_namei   u   local_postal_attributesi   u   extended_network_addressi   u   terminal_typei   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  0  s0   t   ExtensionAttributec           B` s   e  Z d  e i d d 6f d e i d d 6f g Z d Z i e d 6e d 6e d 6e d	 6e	 d
 6e
 d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6Z RS(   u   extension_attribute_typei    u   implicitu   extension_attribute_valuei   u   explicitu   common_nameu   teletex_common_nameu   teletex_organization_nameu   teletex_personal_nameu   teletex_organization_unit_namesu!   teletex_domain_defined_attributesu   pds_nameu   physical_delivery_country_nameu   postal_codeu   physical_delivery_office_nameu   physical_delivery_office_numberu   extension_of_address_componentsu   physical_delivery_personal_nameu#   physical_delivery_organization_nameu.   extension_physical_delivery_address_componentsu   unformatted_postal_addressu   street_addressu   post_office_box_addressu   poste_restante_addressu   unique_postal_nameu   local_postal_attributesu   extended_network_addressu   terminal_type(   u   extension_attribute_typeu   extension_attribute_value(   RI   RJ   R  R   Rz   R   R"   R'   R   R   R   R   R   R   R   R  R  R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  L  s6   t   ExtensionAttributesc           B` s   e  Z e Z RS(    (   RI   RJ   R  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  n  s   t	   ORAddressc           B` s=   e  Z d  e f d e i e d 6f d e i e d 6f g Z RS(   u   built_in_standard_attributesu"   built_in_domain_defined_attributesu   optionalu   extension_attributes(   RI   RJ   R   R   RN   R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  r  s   	t   EDIPartyNamec           B` s;   e  Z d  e i d d 6e d 6f d e i d d 6f g Z RS(   u   name_assigneri    u   implicitu   optionalu
   party_namei   (   RI   RJ   R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  z  s   t   GeneralNamec           B` s   e  Z d  e i d d 6f d e i d d 6f d e i d d 6f d e i d d 6f d	 e i d
 d 6f d e i d d 6f d e i d d 6f d e	 i d d 6f d e
 i d d 6f g	 Z d   Z d   Z RS(   u
   other_namei    u   implicitu   rfc822_namei   u   dns_namei   u   x400_addressi   u   directory_namei   u   explicitu   edi_party_namei   u   uniform_resource_identifieri   u
   ip_addressi   u   registered_idi   c         C` s   |  | k S(   N(    (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5     s    c         C` sz   |  j  d k r* t t d |  j     n  | j  d k rT t t d | j     n  |  j  | j  k rj t S|  j | j k S(   u   
        Does not support other_name, x400_address or edi_party_name

        :param other:
            The other GeneralName to compare to

        :return:
            A boolean
        u
   other_nameu   x400_addressu   edi_party_nameur   
                Comparison is not supported for GeneralName objects of
                choice %s
                ua   
                Comparison is not supported for GeneralName objects of choice
                %s(   u
   other_nameu   x400_addressu   edi_party_name(   u
   other_nameu   x400_addressu   edi_party_name(   R   R^   R   R7   R   (   R3   R4   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:     s    (   RI   RJ   R   RP   R2   R  R   R  RL   R]   R   R   R5   R:   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   	t   GeneralNamesc           B` s   e  Z e Z RS(    (   RI   RJ   R  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR	    s   t   Timec           B` s    e  Z d  e f d e f g Z RS(   u   utc_timeu   general_time(   RI   RJ   R)   R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR
    s   	t   Validityc           B` s    e  Z d  e f d e f g Z RS(   u
   not_beforeu	   not_after(   RI   RJ   R
  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   	t   BasicConstraintsc           B` s4   e  Z d  e i e d 6f d e i e d 6f g Z RS(   u   cau   defaultu   path_len_constraintu   optional(   RI   RJ   R   R7   R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   AuthorityKeyIdentifierc           B` s\   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f d e i d d 6e d 6f g Z RS(   u   key_identifieri    u   implicitu   optionalu   authority_cert_issueri   u   authority_cert_serial_numberi   (   RI   RJ   R    RN   R	  R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   DistributionPointNamec           B` s4   e  Z d  e i d d 6f d e i d d 6f g Z RS(   u	   full_namei    u   implicitu   name_relative_to_crl_issueri   (   RI   RJ   R	  R   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   ReasonFlagsc           B` sM   e  Z i	 d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6d d 6Z RS(   u   unusedi    u   key_compromisei   u   ca_compromisei   u   affiliation_changedi   u
   supersededi   u   cessation_of_operationi   u   certificate_holdi   u   privilege_withdrawni   u   aa_compromisei   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   GeneralSubtreec           B` sK   e  Z d  e f d e i d d 6d d 6f d e i d d 6e d 6f g Z RS(   u   baseu   minimumi    u   implicitu   defaultu   maximumi   u   optional(   RI   RJ   R  R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   	t   GeneralSubtreesc           B` s   e  Z e Z RS(    (   RI   RJ   R  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   NameConstraintsc           B` sB   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f g Z RS(   u   permitted_subtreesi    u   implicitu   optionalu   excluded_subtreesi   (   RI   RJ   R  RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   DistributionPointc           B` sq   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f d e i d d 6e d 6f g Z e Z e	 d	    Z
 RS(
   u   distribution_pointi    u   explicitu   optionalu   reasonsi   u   implicitu
   crl_issueri   c         C` s   |  j  t k r d	 |  _  |  d } | j d k rF t t d    n  xQ | j D]C } | j d k rP | j } | j   j	 d
  r | |  _  Pq qP qP Wn  |  j  S(   u_   
        :return:
            None or a unicode string of the distribution point's URL
        u   distribution_pointu	   full_nameu   
                    CRL distribution points that are relative to the issuer are
                    not supported
                    u   uniform_resource_identifieru   http://u   https://u   ldap://u   ldaps://N(   u   http://u   https://u   ldap://u   ldaps://(
   t   _urlR7   RC   R   R^   R   R   RM   R9   R>   (   R3   R   t   general_namet   url(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s    	
		(   RI   RJ   R  RN   R  R	  Rz   R7   R  R[   R  (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s
    t   CRLDistributionPointsc           B` s   e  Z e Z RS(    (   RI   RJ   R  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  !  s   t   DisplayTextc           B` s2   e  Z d  e f d e f d e f d e f g Z RS(   u
   ia5_stringu   visible_stringu
   bmp_stringu   utf8_string(   RI   RJ   R   R+   R   R*   R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  %  s   			t   NoticeNumbersc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  .  s   t   NoticeReferencec           B` s    e  Z d  e f d e f g Z RS(   u   organizationu   notice_numbers(   RI   RJ   R  R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  2  s   	t
   UserNoticec           B` s4   e  Z d  e i e d 6f d e i e d 6f g Z RS(   u
   notice_refu   optionalu   explicit_text(   RI   RJ   R  RN   R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  9  s   t   PolicyQualifierIdc           B` s   e  Z i d  d 6d d 6Z RS(   u    certification_practice_statementu   1.3.6.1.5.5.7.2.1u   user_noticeu   1.3.6.1.5.5.7.2.2(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  @  s   t   PolicyQualifierInfoc           B` s:   e  Z d  e f d e f g Z d Z i e d 6e d 6Z RS(   u   policy_qualifier_idu	   qualifieru    certification_practice_statementu   user_notice(   u   policy_qualifier_idu	   qualifier(	   RI   RJ   R  R   Rz   R   R   R  R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  G  s   	t   PolicyQualifierInfosc           B` s   e  Z e Z RS(    (   RI   RJ   R  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  T  s   t   PolicyIdentifierc           B` s   e  Z i d  d 6Z RS(   u
   any_policyu   2.5.29.32.0(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  X  s   t   PolicyInformationc           B` s*   e  Z d  e f d e i e d 6f g Z RS(   u   policy_identifieru   policy_qualifiersu   optional(   RI   RJ   R  R  RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR   ^  s   	t   CertificatePoliciesc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR!  e  s   t   PolicyMappingc           B` s    e  Z d  e f d e f g Z RS(   u   issuer_domain_policyu   subject_domain_policy(   RI   RJ   R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR"  i  s   	t   PolicyMappingsc           B` s   e  Z e Z RS(    (   RI   RJ   R"  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR#  p  s   t   PolicyConstraintsc           B` sB   e  Z d  e i d d 6e d 6f d e i d d 6e d 6f g Z RS(   u   require_explicit_policyi    u   implicitu   optionalu   inhibit_policy_mappingi   (   RI   RJ   R   RN   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR$  t  s   t   KeyPurposeIdc           B` sa  e  Z iU 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# 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? 6d@ dA 6dB dC 6dD dE 6dF dG 6dH dI 6dJ dK 6dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6dV dW 6dX dY 6dZ d[ 6d\ d] 6d^ d_ 6d` da 6db dc 6dd de 6df dg 6dh di 6dj dk 6dl dm 6dn do 6dp dq 6dr ds 6dt du 6dv dw 6dx dy 6dz 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 6d d 6d d 6d d 6d d 6d d 6d d 6Z RS(   u   any_extended_key_usageu   2.5.29.37.0u   server_authu   1.3.6.1.5.5.7.3.1u   client_authu   1.3.6.1.5.5.7.3.2u   code_signingu   1.3.6.1.5.5.7.3.3u   email_protectionu   1.3.6.1.5.5.7.3.4u   ipsec_end_systemu   1.3.6.1.5.5.7.3.5u   ipsec_tunnelu   1.3.6.1.5.5.7.3.6u
   ipsec_useru   1.3.6.1.5.5.7.3.7u   time_stampingu   1.3.6.1.5.5.7.3.8u   ocsp_signingu   1.3.6.1.5.5.7.3.9u   dvcsu   1.3.6.1.5.5.7.3.10u   eap_over_pppu   1.3.6.1.5.5.7.3.13u   eap_over_lanu   1.3.6.1.5.5.7.3.14u   scvp_serveru   1.3.6.1.5.5.7.3.15u   scvp_clientu   1.3.6.1.5.5.7.3.16u	   ipsec_ikeu   1.3.6.1.5.5.7.3.17u	   capwap_acu   1.3.6.1.5.5.7.3.18u
   capwap_wtpu   1.3.6.1.5.5.7.3.19u
   sip_domainu   1.3.6.1.5.5.7.3.20u   secure_shell_clientu   1.3.6.1.5.5.7.3.21u   secure_shell_serveru   1.3.6.1.5.5.7.3.22u   send_routeru   1.3.6.1.5.5.7.3.23u   send_proxied_routeru   1.3.6.1.5.5.7.3.24u
   send_owneru   1.3.6.1.5.5.7.3.25u   send_proxied_owneru   1.3.6.1.5.5.7.3.26u   cmc_cau   1.3.6.1.5.5.7.3.27u   cmc_rau   1.3.6.1.5.5.7.3.28u   cmc_archiveu   1.3.6.1.5.5.7.3.29u   bgpspec_routeru   1.3.6.1.5.5.7.3.30u   ike_intermediateu   1.3.6.1.5.5.8.2.2u   microsoft_trust_list_signingu   1.3.6.1.4.1.311.10.3.1u   microsoft_time_stamp_signingu   1.3.6.1.4.1.311.10.3.2u   microsoft_server_gatedu   1.3.6.1.4.1.311.10.3.3u   microsoft_serializedu   1.3.6.1.4.1.311.10.3.3.1u   microsoft_efsu   1.3.6.1.4.1.311.10.3.4u   microsoft_efs_recoveryu   1.3.6.1.4.1.311.10.3.4.1u   microsoft_whqlu   1.3.6.1.4.1.311.10.3.5u   microsoft_nt5u   1.3.6.1.4.1.311.10.3.6u   microsoft_oem_whqlu   1.3.6.1.4.1.311.10.3.7u   microsoft_embedded_ntu   1.3.6.1.4.1.311.10.3.8u   microsoft_root_list_signeru   1.3.6.1.4.1.311.10.3.9u!   microsoft_qualified_subordinationu   1.3.6.1.4.1.311.10.3.10u   microsoft_key_recoveryu   1.3.6.1.4.1.311.10.3.11u   microsoft_document_signingu   1.3.6.1.4.1.311.10.3.12u   microsoft_lifetime_signingu   1.3.6.1.4.1.311.10.3.13u    microsoft_mobile_device_softwareu   1.3.6.1.4.1.311.10.3.14u   microsoft_smart_card_logonu   1.3.6.1.4.1.311.20.2.2u   apple_x509_basicu   1.2.840.113635.100.1.2u	   apple_sslu   1.2.840.113635.100.1.3u   apple_local_cert_genu   1.2.840.113635.100.1.4u   apple_csr_genu   1.2.840.113635.100.1.5u   apple_revocation_crlu   1.2.840.113635.100.1.6u   apple_revocation_ocspu   1.2.840.113635.100.1.7u   apple_smimeu   1.2.840.113635.100.1.8u	   apple_eapu   1.2.840.113635.100.1.9u   apple_software_update_signingu   1.2.840.113635.100.1.10u   apple_ipsecu   1.2.840.113635.100.1.11u   apple_ichatu   1.2.840.113635.100.1.12u   apple_resource_signingu   1.2.840.113635.100.1.13u   apple_pkinit_clientu   1.2.840.113635.100.1.14u   apple_pkinit_serveru   1.2.840.113635.100.1.15u   apple_code_signingu   1.2.840.113635.100.1.16u   apple_package_signingu   1.2.840.113635.100.1.17u   apple_id_validationu   1.2.840.113635.100.1.18u   apple_time_stampingu   1.2.840.113635.100.1.20u   apple_revocationu   1.2.840.113635.100.1.21u   apple_passbook_signingu   1.2.840.113635.100.1.22u   apple_mobile_storeu   1.2.840.113635.100.1.23u   apple_escrow_serviceu   1.2.840.113635.100.1.24u   apple_profile_signeru   1.2.840.113635.100.1.25u   apple_qa_profile_signeru   1.2.840.113635.100.1.26u   apple_test_mobile_storeu   1.2.840.113635.100.1.27u   apple_otapki_signeru   1.2.840.113635.100.1.28u   apple_test_otapki_signeru   1.2.840.113635.100.1.29u)   apple_id_validation_record_signing_policyu   1.2.840.113625.100.1.30u   apple_smp_encryptionu   1.2.840.113625.100.1.31u   apple_test_smp_encryptionu   1.2.840.113625.100.1.32u   apple_server_authenticationu   1.2.840.113635.100.1.33u   apple_pcs_escrow_serviceu   1.2.840.113635.100.1.34u   piv_card_authenticationu   2.16.840.1.101.3.6.8u   piv_content_signingu   2.16.840.1.101.3.6.7u   pkinit_kpclientauthu   1.3.6.1.5.2.3.4u   pkinit_kpkdcu   1.3.6.1.5.2.3.5u   adobe_authentic_documents_trustu   1.2.840.113583.1.1.5u   fpki_pivi_content_signingu   2.16.840.1.101.3.8.7(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR%  {  s   t   ExtKeyUsageSyntaxc           B` s   e  Z e Z RS(    (   RI   RJ   R%  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR&    s   t   AccessMethodc           B` s*   e  Z i d  d 6d d 6d d 6d d 6Z RS(   u   ocspu   1.3.6.1.5.5.7.48.1u
   ca_issuersu   1.3.6.1.5.5.7.48.2u   time_stampingu   1.3.6.1.5.5.7.48.3u   ca_repositoryu   1.3.6.1.5.5.7.48.5(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR'    s
   t   AccessDescriptionc           B` s    e  Z d  e f d e f g Z RS(   u   access_methodu   access_location(   RI   RJ   R'  R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR(    s   	t   AuthorityInfoAccessSyntaxc           B` s   e  Z e Z RS(    (   RI   RJ   R(  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR)    s   t   SubjectInfoAccessSyntaxc           B` s   e  Z e Z RS(    (   RI   RJ   R(  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR*    s   t   Featuresc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR+    s   t   EntrustVersionInfoc           B` s    e  Z d  e f d e f g Z RS(   u   entrust_versu   entrust_info_flags(   RI   RJ   R   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR,    s   	t   NetscapeCertificateTypec           B` sF   e  Z i d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6Z RS(   u
   ssl_clienti    u
   ssl_serveri   u   emaili   u   object_signingi   u   reservedi   u   ssl_cai   u   email_cai   u   object_signing_cai   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR-    s   t   Versionc           B` s#   e  Z i d  d 6d d 6d d 6Z RS(   u   v1i    u   v2i   u   v3i   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR.     s   t   TPMSpecificationc           B` s)   e  Z d  e f d e f d e f g Z RS(   u   familyu   levelu   revision(   RI   RJ   R*   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR/  (  s   		t   SetOfTPMSpecificationc           B` s   e  Z e Z RS(    (   RI   RJ   R/  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR0  0  s   t   TCGSpecificationVersionc           B` s)   e  Z d  e f d e f d e f g Z RS(   u   major_versionu   minor_versionu   revision(   RI   RJ   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR1  4  s   		t   TCGPlatformSpecificationc           B` s    e  Z d  e f d e f g Z RS(   u   versionu   platform_class(   RI   RJ   R1  R    Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR2  <  s   	t   SetOfTCGPlatformSpecificationc           B` s   e  Z e Z RS(    (   RI   RJ   R2  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR3  C  s   t   EKGenerationTypec           B` s*   e  Z i d  d 6d d 6d d 6d d 6Z RS(   u   internali    u   injectedi   u   internal_revocablei   u   injected_revocablei   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR4  G  s
   t   EKGenerationLocationc           B` s#   e  Z i d  d 6d d 6d d 6Z RS(   u   tpm_manufactureri    u   platform_manufactureri   u   ek_cert_signeri   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR5  P  s   t   EKCertificateGenerationLocationc           B` s#   e  Z i d  d 6d d 6d d 6Z RS(   u   tpm_manufactureri    u   platform_manufactureri   u   ek_cert_signeri   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR6  X  s   t   EvaluationAssuranceLevelc           B` s?   e  Z i d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6Z RS(   u   level1i   u   level2i   u   level3i   u   level4i   u   level5i   u   level6i   u   level7i   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR7  `  s   t   EvaluationStatusc           B` s#   e  Z i d  d 6d d 6d d 6Z RS(   u   designed_to_meeti    u   evaluation_in_progressi   u   evaluation_completedi   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR8  l  s   t   StrengthOfFunctionc           B` s#   e  Z i d  d 6d d 6d d 6Z RS(   u   basici    u   mediumi   u   highi   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR9  t  s   t   URIReferencec           B` s=   e  Z d  e f d e i e d 6f d e i e d 6f g Z RS(   u   uniform_resource_identifieru   hash_algorithmu   optionalu
   hash_value(   RI   RJ   R   R   RN   R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR:  |  s   	t   CommonCriteriaMeasuresc           B` s   e  Z d  e f d e f d e f d e i e d 6f d e i d d 6e d 6f d	 e	 i d
 d 6e d 6f d e
 i d d 6e d 6f d e	 i d d 6e d 6f d e
 i d d 6e d 6f g	 Z RS(   u   versionu   assurance_levelu   evaluation_statusu   plusu   defaultu   strengh_of_functioni    u   implicitu   optionalu   profile_oidi   u   profile_urli   u
   target_oidi   u
   target_urii   (   RI   RJ   R   R7  R8  R   R7   R9  RN   R   R:  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR;    s   			t   SecurityLevelc           B` s*   e  Z i d  d 6d d 6d d 6d d 6Z RS(   u   level1i   u   level2i   u   level3i   u   level4i   (   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR<    s
   t	   FIPSLevelc           B` s3   e  Z d  e f d e f d e i e d 6f g Z RS(   u   versionu   levelu   plusu   default(   RI   RJ   R   R<  R   R7   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR=    s   		t   TPMSecurityAssertionsc           B` s   e  Z d  e i d d 6f d e i e d 6f d e i d d 6e d 6f d e i d	 d 6e d 6f d
 e i d d 6e d 6f d e	 i d d 6e d 6f d e
 i d d 6e d 6f d e i d d 6e d 6f d e i e d 6f g	 Z RS(   u   versionu   v1u   defaultu   field_upgradableu   ek_generation_typei    u   implicitu   optionalu   ek_generation_locationi   u"   ek_certificate_generation_locationi   u   cc_infoi   u
   fips_leveli   u   iso_9000_certifiedi   u   iso_9000_uri(   RI   RJ   R.  R   R7   R4  RN   R5  R6  R;  R=  R   Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR>    s   t   SetOfTPMSecurityAssertionsc           B` s   e  Z e Z RS(    (   RI   RJ   R>  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR?    s   t   SubjectDirectoryAttributeIdc           B` sT   e  Z i
 d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6d d 6d d 6Z RS(   u   supported_algorithmsu   2.5.4.52u   tpm_specificationu   2.23.133.2.16u   tcg_platform_specificationu   2.23.133.2.17u   tpm_security_assertionsu   2.23.133.2.18u   pda_date_of_birthu   1.3.6.1.5.5.7.9.1u   pda_place_of_birthu   1.3.6.1.5.5.7.9.2u
   pda_genderu   1.3.6.1.5.5.7.9.3u   pda_country_of_citizenshipu   1.3.6.1.5.5.7.9.4u   pda_country_of_residenceu   1.3.6.1.5.5.7.9.5u   entrust_user_roleu   1.2.840.113533.7.68.29(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR@    s   t   SetOfGeneralizedTimec           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRA    s   t   SetOfDirectoryStringc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRB    s   t   SetOfPrintableStringc           B` s   e  Z e Z RS(    (   RI   RJ   R"   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRC    s   t   SupportedAlgorithmc           B` sK   e  Z d  e f d e i d d 6e d 6f d e i d d 6e d 6f g Z RS(   u   algorithm_identifieru   intended_usagei    u   explicitu   optionalu   intended_certificate_policiesi   (   RI   RJ   R   R}   RN   R!  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRD    s   	t   SetOfSupportedAlgorithmc           B` s   e  Z e Z RS(    (   RI   RJ   RD  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRE    s   t   SubjectDirectoryAttributec           B` s   e  Z d  e f d e f g Z d Z i	 e d 6e d 6e d 6e	 d 6e
 d 6e d 6e d 6e d	 6e d
 6Z d   Z i e d 6Z RS(   u   typeu   valuesu   supported_algorithmsu   tpm_specificationu   tcg_platform_specificationu   tpm_security_assertionsu   pda_date_of_birthu   pda_place_of_birthu
   pda_genderu   pda_country_of_citizenshipu   pda_country_of_residencec         C` s+   |  d j  } | |  j k r' |  j | St S(   Nu   type(   RM   R   R&   (   R3   t   type_(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   _values_spec  s    (   u   typeu   values(   RI   RJ   R@  R   Rz   R   RE  R0  R3  R?  RA  RB  RC  R   RH  t   _spec_callbacks(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRF    s    	
	t   SubjectDirectoryAttributesc           B` s   e  Z e Z RS(    (   RI   RJ   RF  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRJ    s   t   ExtensionIdc           B` s   e  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# 6d$ d% 6d& d' 6d( d) 6d* d+ 6d, d- 6Z RS(.   u   subject_directory_attributesu   2.5.29.9u   key_identifieru	   2.5.29.14u	   key_usageu	   2.5.29.15u   private_key_usage_periodu	   2.5.29.16u   subject_alt_nameu	   2.5.29.17u   issuer_alt_nameu	   2.5.29.18u   basic_constraintsu	   2.5.29.19u   name_constraintsu	   2.5.29.30u   crl_distribution_pointsu	   2.5.29.31u   certificate_policiesu	   2.5.29.32u   policy_mappingsu	   2.5.29.33u   authority_key_identifieru	   2.5.29.35u   policy_constraintsu	   2.5.29.36u   extended_key_usageu	   2.5.29.37u   freshest_crlu	   2.5.29.46u   inhibit_any_policyu	   2.5.29.54u   authority_information_accessu   1.3.6.1.5.5.7.1.1u   subject_information_accessu   1.3.6.1.5.5.7.1.11u   tls_featureu   1.3.6.1.5.5.7.1.24u   ocsp_no_checku   1.3.6.1.5.5.7.48.1.5u   entrust_version_extensionu   1.2.840.113533.7.65.0u   netscape_certificate_typeu   2.16.840.1.113730.1.1u!   signed_certificate_timestamp_listu   1.3.6.1.4.1.11129.2.4.2(   RI   RJ   R~   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRK    s0   t	   Extensionc           B` s   e  Z d  e f d e i e d 6f d e f g Z d Z i e d 6e	 d 6e
 d 6e d 6e d 6e d	 6e d
 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e	 d 6Z RS(   u   extn_idu   criticalu   defaultu
   extn_valueu   subject_directory_attributesu   key_identifieru	   key_usageu   private_key_usage_periodu   subject_alt_nameu   issuer_alt_nameu   basic_constraintsu   name_constraintsu   crl_distribution_pointsu   certificate_policiesu   policy_mappingsu   authority_key_identifieru   policy_constraintsu   extended_key_usageu   freshest_crlu   inhibit_any_policyu   authority_information_accessu   subject_information_accessu   tls_featureu   ocsp_no_checku   entrust_version_extensionu   netscape_certificate_typeu!   signed_certificate_timestamp_list(   u   extn_idu
   extn_value(   RI   RJ   RK  R   R7   R!   Rz   R   RJ  R    R}   R   R	  R  R  R  R!  R#  R  R$  R&  R   R)  R*  R+  R   R,  R-  R   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRL     s8   	t
   Extensionsc           B` s   e  Z e Z RS(    (   RI   RJ   RL  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRM  C  s   t   TbsCertificatec           B` s   e  Z d  e i d d 6d d 6f d e f d e f d e f d e f d	 e f d
 e f d e i d d 6e	 d 6f d e i d d 6e	 d 6f d e
 i d d 6e	 d 6f g
 Z RS(   u   versioni    u   explicitu   v1u   defaultu   serial_numberu	   signatureu   issueru   validityu   subjectu   subject_public_key_infou   issuer_unique_idi   u   implicitu   optionalu   subject_unique_idi   u
   extensionsi   (   RI   RJ   R.  R   R   R   R  R-   R   RN   RM  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRN  G  s   						t   Certificatec           B` s  e  Z d  e f d e f d e f g Z e Z d7 Z	 d7 Z
 d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z d7 Z e Z d7 Z  d7 Z! d7 Z" d7 Z# d7 Z$ d7 Z% d7 Z& d7 Z' d   Z( e) d    Z* e) d    Z+ e) d    Z, e) d    Z- e) d    Z. e) d	    Z/ e) d
    Z0 e) d    Z1 e) d    Z2 e) d    Z3 e) d    Z4 e) d    Z5 e) d    Z6 e) d    Z7 e) d    Z8 e) d    Z9 e) d    Z: e) d    Z; e) d    Z< e) d    Z= e) d    Z> e) d    Z? e) d    Z@ e) d    ZA e) d    ZB e) d    ZC e) d    ZD e) d    ZE e) d     ZF e) d!    ZG e) d"    ZH e) d#    ZI e) d$    ZJ e) d%    ZK e) d&    ZL e) d'    ZM d(   ZN e) d)    ZO e) d*    ZP e) d+    ZQ e) d,    ZR e) d-    ZS e) d.    ZT e) d/    ZU e) d0    ZV e) d1    ZW e) d2    ZX e) d3    ZY d4   ZZ d5   Z[ d6   Z\ RS(8   u   tbs_certificateu   signature_algorithmu   signature_valuec         C` s   t    |  _ xv |  d d D]f } | d j } d | } t |  |  ra t |  | | d j  n  | d j r |  j j |  q q Wt |  _ d S(   uv   
        Sets common named extensions to private attributes and creates a list
        of critical extensions
        u   tbs_certificateu
   extensionsu   extn_idu	   _%s_valueu
   extn_valueu   criticalN(	   RH   t   _critical_extensionsRM   t   hasattrt   setattrt   parsedt   addRN   t   _processed_extensions(   R3   t	   extensionR   R   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   _set_extensions~  s    
c         C` s   |  j  s |  j   n  |  j S(   u   
        Returns a set of the names (or OID if not a known extension) of the
        extensions marked as critical

        :return:
            A set of unicode strings
        (   RU  RW  RP  (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   critical_extensions  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to constrain the period over which the subject
        private key may be used

        :return:
            None or a PrivateKeyUsagePeriod object
        (   RU  RW  t   _private_key_usage_period_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   private_key_usage_period_value  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to contain additional identification attributes
        about the subject.

        :return:
            None or a SubjectDirectoryAttributes object
        (   RU  RW  t   _subject_directory_attributes(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt"   subject_directory_attributes_value  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to help in creating certificate validation paths.
        It contains an identifier that should generally, but is not guaranteed
        to, be unique.

        :return:
            None or an OctetString object
        (   RU  RW  t   _key_identifier_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   key_identifier_value  s    	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to define the purpose of the public key
        contained within the certificate.

        :return:
            None or a KeyUsage
        (   RU  RW  t   _key_usage_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   key_usage_value  s    
	c         C` s   |  j  s |  j   n  |  j S(   uT  
        This extension allows for additional names to be associate with the
        subject of the certificate. While it may contain a whole host of
        possible names, it is usually used to allow certificates to be used
        with multiple different domain names.

        :return:
            None or a GeneralNames object
        (   RU  RW  t   _subject_alt_name_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   subject_alt_name_value  s    	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension allows associating one or more alternative names with
        the issuer of the certificate.

        :return:
            None or an x509.GeneralNames object
        (   RU  RW  t   _issuer_alt_name_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   issuer_alt_name_value  s    
	c         C` s   |  j  s |  j   n  |  j S(   u'  
        This extension is used to determine if the subject of the certificate
        is a CA, and if so, what the maximum number of intermediate CA certs
        after this are, before an end-entity certificate is found.

        :return:
            None or a BasicConstraints object
        (   RU  RW  t   _basic_constraints_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   basic_constraints_value  s    	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used in CA certificates, and is used to limit the
        possible names of certificates issued.

        :return:
            None or a NameConstraints object
        (   RU  RW  t   _name_constraints_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   name_constraints_value	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to help in locating the CRL for this certificate.

        :return:
            None or a CRLDistributionPoints object
            extension
        (   RU  RW  t   _crl_distribution_points_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   crl_distribution_points_value	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u;  
        This extension defines policies in CA certificates under which
        certificates may be issued. In end-entity certificates, the inclusion
        of a policy indicates the issuance of the certificate follows the
        policy.

        :return:
            None or a CertificatePolicies object
        (   RU  RW  t   _certificate_policies_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   certificate_policies_value 	  s    	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension allows mapping policy OIDs to other OIDs. This is used
        to allow different policies to be treated as equivalent in the process
        of validation.

        :return:
            None or a PolicyMappings object
        (   RU  RW  t   _policy_mappings_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   policy_mappings_value0	  s    	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension helps in identifying the public key with which to
        validate the authenticity of the certificate.

        :return:
            None or an AuthorityKeyIdentifier object
        (   RU  RW  t   _authority_key_identifier_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   authority_key_identifier_value?	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to control if policy mapping is allowed and
        when policies are required.

        :return:
            None or a PolicyConstraints object
        (   RU  RW  t   _policy_constraints_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   policy_constraints_valueM	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to help locate any available delta CRLs

        :return:
            None or an CRLDistributionPoints object
        (   RU  RW  t   _freshest_crl_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   freshest_crl_value[	  s    		c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to prevent mapping of the any policy to
        specific requirements

        :return:
            None or a Integer object
        (   RU  RW  t   _inhibit_any_policy_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   inhibit_any_policy_valueh	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to define additional purposes for the public key
        beyond what is contained in the basic constraints.

        :return:
            None or an ExtKeyUsageSyntax object
        (   RU  RW  t   _extended_key_usage_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   extended_key_usage_valuev	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to locate the CA certificate used to sign this
        certificate, or the OCSP responder for this certificate.

        :return:
            None or an AuthorityInfoAccessSyntax object
        (   RU  RW  t#   _authority_information_access_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt"   authority_information_access_value	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to access information about the subject of this
        certificate.

        :return:
            None or a SubjectInfoAccessSyntax object
        (   RU  RW  t!   _subject_information_access_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt    subject_information_access_value	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u   
        This extension is used to list the TLS features a server must respond
        with if a client initiates a request supporting them.

        :return:
            None or a Features object
        (   RU  RW  t   _tls_feature_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   tls_feature_value	  s    
	c         C` s   |  j  s |  j   n  |  j S(   u-  
        This extension is used on certificates of OCSP responders, indicating
        that revocation information for the certificate should never need to
        be verified, thus preventing possible loops in path validation.

        :return:
            None or a Null object (if present)
        (   RU  RW  t   _ocsp_no_check_value(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   ocsp_no_check_value	  s    	c         C` s   |  d j  S(   uE   
        :return:
            A byte string of the signature
        u   signature_value(   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt	   signature	  s    c         C` s   |  d j  S(   uj   
        :return:
            A unicode string of "rsassa_pkcs1v15", "rsassa_pss", "dsa", "ecdsa"
        u   signature_algorithm(   t   signature_algo(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  	  s    c         C` s   |  d j  S(   u   
        :return:
            A unicode string of "md2", "md5", "sha1", "sha224", "sha256",
            "sha384", "sha512", "sha512_224", "sha512_256"
        u   signature_algorithm(   t	   hash_algo(   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  	  s    c         C` s   |  d d S(   uT   
        :return:
            The PublicKeyInfo object for this certificate
        u   tbs_certificateu   subject_public_key_info(    (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt
   public_key	  s    c         C` s   |  d d S(   uZ   
        :return:
            The Name object for the subject of this certificate
        u   tbs_certificateu   subject(    (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   subject	  s    c         C` s   |  d d S(   uY   
        :return:
            The Name object for the issuer of this certificate
        u   tbs_certificateu   issuer(    (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   issuer	  s    c         C` s   |  d d j  S(   uT   
        :return:
            An integer of the certificate's serial number
        u   tbs_certificateu   serial_number(   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   serial_number	  s    c         C` s   |  j  s d S|  j  j S(   u   
        :return:
            None or a byte string of the certificate's key identifier from the
            key identifier extension
        N(   R^  RC   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   key_identifier	  s    	c         C` sB   |  j  d k r; |  j j d t |  j  j d  |  _  n  |  j  S(   u   
        :return:
            A byte string of the SHA-256 hash of the issuer concatenated with
            the ascii character ":", concatenated with the serial number as
            an ascii string
        t   :u   asciiN(   t   _issuer_serialRC   R  R   R   R  R?   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   issuer_serial

  s    	,c         C` s   |  d d d j  S(   ud   
        :return:
            A datetime of latest time when the certificate is still valid
        u   tbs_certificateu   validityu	   not_after(   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   not_valid_after
  s    c         C` s   |  d d d j  S(   ud   
        :return:
            A datetime of the earliest time when the certificate is valid
        u   tbs_certificateu   validityu
   not_before(   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   not_valid_before
  s    c         C` s   |  j  s d S|  j  d j S(   u   
        :return:
            None or a byte string of the key_identifier from the authority key
            identifier extension
        u   key_identifierN(   Rp  RC   RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   authority_key_identifier'
  s    	c         C` s   |  j  t k r |  j } | r | d j r |  j d d j } | j   } |  j d j } | j d t |  j d  |  _  q d |  _  n  |  j  S(   u;  
        :return:
            None or a byte string of the SHA-256 hash of the isser from the
            authority key identifier extension concatenated with the ascii
            character ":", concatenated with the serial number from the
            authority key identifier extension as an ascii string
        u   authority_cert_issueri    u   authority_cert_serial_numberR  u   asciiN(
   t   _authority_issuer_serialR7   Rp  RM   R   t   untagR   R   R?   RC   (   R3   t   akivR  t   authority_serial(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   authority_issuer_serial4
  s    
	&c         C` s.   |  j  d k r' |  j |  j  |  _  n  |  j  S(   u   
        Returns complete CRL URLs - does not include delta CRLs

        :return:
            A list of zero or more DistributionPoint objects
        N(   t   _crl_distribution_pointsRC   t!   _get_http_crl_distribution_pointsRj  (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   crl_distribution_pointsJ
  s    	c         C` s.   |  j  d k r' |  j |  j  |  _  n  |  j  S(   u   
        Returns delta CRL URLs - does not include complete CRLs

        :return:
            A list of zero or more DistributionPoint objects
        N(   t   _delta_crl_distribution_pointsRC   R  Rt  (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   delta_crl_distribution_pointsW
  s    	c         C` s   g  } | d k r g  Sxr | D]j } | d } | t k r? q n  | j d k rT q n  x0 | j D]% } | j d k r^ | j |  q^ q^ Wq W| S(   u?  
        Fetches the DistributionPoint object for non-relative, HTTP CRLs
        referenced by the certificate

        :param crl_distribution_points:
            A CRLDistributionPoints object to grab the DistributionPoints from

        :return:
            A list of zero or more DistributionPoint objects
        u   distribution_pointu   name_relative_to_crl_issueru   uniform_resource_identifierN(   RC   R,   R   R   R   (   R3   R  R   t   distribution_pointt   distribution_point_nameR  (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  d
  s    
c         C` s   |  j  s g  Sg  } xt |  j  D]i } | d j d k r | d } | j d k rU q n  | j } | j   j d	  r | j |  q q q W| S(
   ux   
        :return:
            A list of zero or more unicode strings of the OCSP URLs for this
            cert
        u   access_methodu   ocspu   access_locationu   uniform_resource_identifieru   http://u   https://u   ldap://u   ldaps://(   u   http://u   https://u   ldap://u   ldaps://(   Rz  RM   R   R9   R>   R   (   R3   R   t   entryt   locationR  (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt	   ocsp_urls
  s    	
	c         C` s   |  j  d k r g  |  _  |  j ro x |  j D]= } | j d k r+ | j |  j  k r+ |  j  j | j  q+ q+ Wq t j d  } xm |  j j	 D]\ } xS | D]K } | d j d k r | d j } | j
 |  r |  j  j |  q q q Wq Wn  |  j  S(   u   
        :return:
            A list of unicode strings of valid domain names for the certificate.
            Wildcard certificates will have a domain in the form: *.example.com
        u   dns_nameuE   ^(\*\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$u   typeu   common_nameu   valueN(   t   _valid_domainsRC   Rb  R   RM   R   R   t   compileR  R   t   match(   R3   R  t   patternR   t   name_type_valueRF   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   valid_domains
  s    		!!c         C` sg   |  j  d k r` g  |  _  |  j r` x9 |  j D]+ } | j d k r+ |  j  j | j  q+ q+ Wq` n  |  j  S(   uj   
        :return:
            A list of unicode strings of valid IP addresses for the certificate
        u
   ip_addressN(   t
   _valid_ipsRC   Rb  R   R   RM   (   R3   R  (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt	   valid_ips
  s    		 c         C` s   |  j  o |  j  d j S(   uW   
        :return;
            A boolean - if the certificate is marked as a CA
        u   ca(   Rf  RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   ca
  s    c         C` s   |  j  s d S|  j d j S(   uT   
        :return;
            None or an integer of the maximum path length
        u   path_len_constraintN(   R  RC   Rf  RM   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   max_path_length
  s    	c         C` s.   |  j  d k r' |  j |  j k |  _  n  |  j  S(   ux   
        :return:
            A boolean - if the certificate is self-issued, as defined by RFC
            5280
        N(   t   _self_issuedRC   R  R  (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   self_issued
  s    c         C` sv   |  j  d k ro d |  _  |  j ro |  j r` |  j s? d |  _  qi |  j |  j k ri d |  _  qi ql d |  _  qo n  |  j  S(   u  
        :return:
            A unicode string of "no" or "maybe". The "maybe" result will
            be returned if the certificate issuer and subject are the same.
            If a key identifier and authority key identifier are present,
            they will need to match otherwise "no" will be returned.

            To verify is a certificate is truly self-signed, the signature
            will need to be verified. See the certvalidator package for
            one possible solution.
        u   nou   maybeN(   t   _self_signedRC   R  R  R  (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   self_signed
  s    				c         C` s7   |  j  d k r0 t j |  j    j   |  _  n  |  j  S(   uk   
        :return:
            The SHA-1 hash of the DER-encoded bytes of this complete certificate
        N(   R   RC   R   R   R   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s    !c         C` s    d j  d   t |  j  D  S(   u   
        :return:
            A unicode string of the SHA-1 hash, formatted using hex encoding
            with a space between each pair of characters, all uppercase
        u    c         s` s   |  ] } d  | Vq d S(   u   %02XN(    (   R   t   c(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pys	   <genexpr>  s    (   R   R   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   sha1_fingerprint  s    c         C` s7   |  j  d k r0 t j |  j    j   |  _  n  |  j  S(   uy   
        :return:
            The SHA-256 hash of the DER-encoded bytes of this complete
            certificate
        N(   R   RC   R   R   R   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR     s    !c         C` s    d j  d   t |  j  D  S(   u   
        :return:
            A unicode string of the SHA-256 hash, formatted using hex encoding
            with a space between each pair of characters, all uppercase
        u    c         s` s   |  ] } d  | Vq d S(   u   %02XN(    (   R   R  (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pys	   <genexpr>0  s    (   R   R   R   (   R3   (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   sha256_fingerprint(  s    c         C` s  t  | t  s- t t d t |     n  | j d  j d  j   } | j d  d k } | ov t	 j
 d |  } | o | } | rG|  j s t S| j d  } x |  j D] } | j d  j d  j   } | j d  }	 t |	  t |  k rq n  |	 | k rt S|  j |  }
 |
 r |  j | |	  r t Sq Wt S|  j sTt S| rct j n t j } t | |  } xW |  j D]L } | j d  d k rt j n t j } t | |  } | | k rt SqWt S(   u  
        Check if a domain name or IP address is valid according to the
        certificate

        :param domain_ip:
            A unicode string of a domain name or IP address

        :return:
            A boolean - if the domain or IP is valid for the certificate
        uL   
                domain_ip must be a unicode string, not %s
                u   idnau   asciiu   :iu   ^\d+\.\d+\.\d+\.\d+$u   .(   R6   R   R=   R   R
   R?   RX   R9   RT   R   R  R  R7   Rb   Rg   RN   t   _is_wildcard_domaint   _is_wildcard_matchR  Rd   Rf   Re   R1   (   R3   t	   domain_ipt   encoded_domain_ipt   is_ipv6t   is_ipv4t	   is_domaint   domain_labelst   valid_domaint   encoded_valid_domaint   valid_domain_labelst   is_wildcardRn   t   normalized_ipt   valid_ipt   valid_familyt   normalized_valid_ip(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   is_valid_domain_ip2  sB    		'c         C` st   | j  d  d k r t S| j   j d  } | s8 t S| d j d  d k rU t S| d d d !d k rp t St S(   uf  
        Checks if a domain is a valid wildcard according to
        https://tools.ietf.org/html/rfc6125#section-6.4.3

        :param domain:
            A unicode string of the domain name, where any U-labels from an IDN
            have been converted to A-labels

        :return:
            A boolean - if the domain is a valid wildcard domain
        u   *i   u   .i    ii   u   xn--(   t   countR7   R9   Rb   RT   RN   (   R3   t   domaint   labels(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR  t  s    c         C` s   | d } | d } | d } | d } | | k r8 t  S| d k rH t St j d | j d d  d  } | j |  r~ t St  S(   u  
        Determines if the labels in a domain are a match for labels from a
        wildcard valid domain name

        :param domain_labels:
            A list of unicode strings, with A-label form for IDNs, of the labels
            in the domain name to check

        :param valid_domain_labels:
            A list of unicode strings, with A-label form for IDNs, of the labels
            in a wildcard domain pattern

        :return:
            A boolean - if the domain matches the valid domain
        i    i   u   *u   ^u   .*u   $(   R7   RN   R   R  R   R  (   R3   R  R  t   first_domain_labelt   other_domain_labelst   wildcard_labelt   other_valid_domain_labelst   wildcard_regex(    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s    



#N(]   RI   RJ   RN  R   R   Rz   R7   RU  RC   RP  R[  R]  R_  Ra  Rc  Re  Rg  Ri  Rk  Rm  Ro  Rq  Rs  Ru  Rw  Ry  R{  RY  R}  R  R  R  R  R  R  R  R  R  R   R   RW  R[   RX  RZ  R\  R^  R`  Rb  Rd  Rf  Rh  Rj  Rl  Rn  Rp  Rr  Rt  Rv  Rx  Rz  R|  R~  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R  R   R  R  R  R  (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyRO  V  s   					
					#	

	B	!t   KeyPurposeIdentifiersc           B` s   e  Z e Z RS(    (   RI   RJ   R%  R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   SequenceOfAlgorithmIdentifiersc           B` s   e  Z e Z RS(    (   RI   RJ   R   R|   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   t   CertificateAuxc        	   B` s{   e  Z d  e i e d 6f d e i d d 6e d 6f d e i e d 6f d e i e d 6f d e i d d 6e d 6f g Z RS(	   u   trustu   optionalu   rejecti    u   implicitu   aliasu   keyidu   otheri   (   RI   RJ   R  RN   R*   R    R  Rz   (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s
   t   TrustedCertificatec           B` s   e  Z e e g Z RS(    (   RI   RJ   RO  R  t   _child_specs(    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyR    s   (   R   t
   __future__R    R   R   R   t
   contextlibR   t	   encodingsR   R   R   Rd   R   R   R   t   _errorsR   t   _iriR   R   t   _ordereddictR	   t   _typesR
   R   R   t   algosR   R   R   R   t   coreR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R   R-   t   utilR.   R/   R0   R1   R2   RL   RP   R]   Ry   R{   R}   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R  R  R  R  R  R	  R
  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R!  R"  R#  R$  R%  R&  R'  R(  R)  R*  R+  R,  R-  R.  R/  R0  R1  R2  R3  R4  R5  R6  R7  R8  R9  R:  R;  R<  R=  R>  R?  R@  RA  RB  RC  RD  RE  RF  RJ  RK  RL  RM  RN  RO  R  R  R  R  (    (    (    s.   lib/python2.7/site-packages/asn1crypto/x509.pyt   <module>   s  """59q	U*

			"2%	p			#   l
