§
    ÎÑßj1õ  ã                  ó  — U 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mZ d dl	m
Z
 d dlmZ d dlmZmZmZ ej        dk    rd dlmZ nd dlmZ d d	lmZmZ d d
lmZmZmZmZmZ d dlmZ d dlmZ d dlm Z! d dlm"Z# d dlm$Z% d dlm&Z' d dlm(Z) g d¢Z*eej+        ej,        ej-        ej.        ej/        f         Z0eej1        ej2        ej3        ej4        ej5        f         Z6ee0e6f         Z7ee8ede8f         f         Z9e%j:        Z;de<d<   e%j=        Z>de<d<   dZ?e%j@        ZAde<d<   e%jB        ZCde<d<   e%jD        ZEde<d<   e%jF        ZGde<d<    G d„ deH¦  «        ZI ee!eI¦  «        ZJ e'eI¦  «        ZKdZd[d"„ZLd\d%„ZMd]d)„ZNd^d*„ZOd_d,„ZP G d-„ d.¦  «        ZQ G d/„ d0¦  «        ZR G d1„ d2¦  «        ZS ed3¦  «        d`d5„¦   «         ZT ed6¦  «        dad9„¦   «         ZU ed:¦  «        ejV         G d;„ d<¦  «        ¦   «         ¦   «         ZW G d=„ d>¦  «        ZX G d?„ d@¦  «        ZY G dA„ dB¦  «        ZZ G dC„ dDeH¦  «        Z[ G dE„ dF¦  «        Z\dbdH„Z]dcdJ„Z^dddL„Z_	 	 dedfdQ„Z`e`Za ej        e`ebdRecdS¬T¦  «          G dU„ dV¦  «        ZddgdX„Ze	 dZdhdY„ZfdS )ié    )ÚannotationsN)Ú	b16encode)ÚSequence)Úpartial)ÚAnyÚCallableÚUnion)é   é   )Ú
deprecated)ÚutilsÚx509)ÚdsaÚecÚed448Úed25519Úrsa)ÚStrOrBytesPath)Úbyte_string)Úexception_from_error_queue)Úffi)Úlib)Úmake_assert)Ú
path_bytes)ÚFILETYPE_ASN1ÚFILETYPE_PEMÚFILETYPE_TEXTÚTYPE_DSAÚTYPE_RSAÚX509ÚErrorÚPKeyÚX509NameÚ	X509StoreÚX509StoreContextÚX509StoreContextErrorÚX509StoreFlagsÚdump_certificateÚdump_privatekeyÚdump_publickeyÚget_elliptic_curveÚget_elliptic_curvesÚload_certificateÚload_privatekeyÚload_publickey.Úintr   r   iÿÿ  r   r   ÚTYPE_DHÚTYPE_ECc                  ó   — e Zd ZdZdS )r!   z7
    An error occurred in an `OpenSSL.crypto` API.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úB/opt/saltstack/salt/lib/python3.11/site-packages/OpenSSL/crypto.pyr!   r!   j   s   € € € € € ðð ð ð r9   r!   Úbufferúbytes | NoneÚreturnr   c                óL  — | €2t          j        t          j        ¦   «         ¦  «        }t           j        }n=t	          j        d| ¦  «        }t          j        |t          | ¦  «        ¦  «        }|fdd„}t          |t          j	        k    ¦  «         t	          j
        ||¦  «        }|S )	zÙ
    Allocate a new OpenSSL memory BIO.

    Arrange for the garbage collector to clean it up automatically.

    :param buffer: None or some bytes to use to put into the BIO so that they
        can be read out.
    Núchar[]Úbior   Úrefr=   c                ó*   — t          j        | ¦  «        S ©N)Ú_libÚBIO_free)r@   rA   s     r:   Úfreez_new_mem_buf.<locals>.free…   s   € Ý”= Ñ%Ô%Ð%r9   )r@   r   rA   r   r=   r   )rD   ÚBIO_newÚ	BIO_s_memrE   Ú_ffiÚnewÚBIO_new_mem_bufÚlenÚ_openssl_assertÚNULLÚgc)r;   r@   rF   Údatas       r:   Ú_new_mem_bufrQ   t   s�   € ð €~ÝŒl�4œ>Ñ+Ô+Ñ,Ô,ˆÝŒ}ˆˆåŒx˜ &Ñ)Ô)ˆÝÔ" 4­¨V©¬Ñ5Ô5ˆð '+ð 	&ð 	&ð 	&ð 	&ð 	&õ �C�4œ9Ò$Ñ%Ô%Ð%å
Œ'�#�tÑ
Ô
€CØ€Jr9   r@   Úbytesc                óš   — t          j        d¦  «        }t          j        | |¦  «        }t          j        |d         |¦  «        dd…         S )zO
    Copy the contents of an OpenSSL BIO object into a Python byte string.
    zchar**r   N)rI   rJ   rD   ÚBIO_get_mem_datar;   )r@   Úresult_bufferÚbuffer_lengths      r:   Ú_bio_to_stringrW   Ž   sE   € õ ”H˜XÑ&Ô&€MÝÔ)¨#¨}Ñ=Ô=€MÝŒ;�} QÔ'¨Ñ7Ô7¸¸¸Ô:Ð:r9   ÚboundaryÚwhenÚNonec                óÜ   — t          |t          ¦  «        st          d¦  «        ‚t          | t          j        k    ¦  «         t          j        | |¦  «        }|dk    rt          d¦  «        ‚dS )aô  
    The the time value of an ASN1 time object.

    @param boundary: An ASN1_TIME pointer (or an object safely
        castable to that type) which will have its value set.
    @param when: A string representation of the desired time value.

    @raise TypeError: If C{when} is not a L{bytes} string.
    @raise ValueError: If C{when} does not represent a time in the required
        format.
    @raise RuntimeError: If the time value cannot be set for some other
        (unspecified) reason.
    zwhen must be a byte stringr   zInvalid stringN)	Ú
isinstancerR   Ú	TypeErrorrM   rI   rN   rD   ÚASN1_TIME_set_stringÚ
ValueError)rX   rY   Ú
set_results      r:   Ú_set_asn1_timera   —   sm   € õ �d�EÑ"Ô"ð 6ÝÐ4Ñ5Ô5Ð5õ �H¥¤	Ò)Ñ*Ô*Ð*åÔ*¨8°TÑ:Ô:€JØ�Q‚€ÝÐ)Ñ*Ô*Ð*ð €r9   c                óÄ   — t          j        ¦   «         }t          |t          j        k    ¦  «         t          j        |t           j        ¦  «        }t          || ¦  «         |S )aŒ  
    Behaves like _set_asn1_time but returns a new ASN1_TIME object.

    @param when: A string representation of the desired time value.

    @raise TypeError: If C{when} is not a L{bytes} string.
    @raise ValueError: If C{when} does not represent a time in the required
        format.
    @raise RuntimeError: If the time value cannot be set for some other
        (unspecified) reason.
    )rD   ÚASN1_TIME_newrM   rI   rN   rO   ÚASN1_TIME_freera   )rY   Úrets     r:   Ú_new_asn1_timerf   °   sP   € õ Ô
Ñ
Ô
€CÝ�C�4œ9Ò$Ñ%Ô%Ð%Ý
Œ'�#•tÔ*Ñ
+Ô
+€CÝ�3˜ÑÔÐØ€Jr9   Ú	timestampc                óF  — t          j        d| ¦  «        }t          j        |¦  «        dk    rdS t          j        |¦  «        t          j        k    r&t          j        t          j        |¦  «        ¦  «        S t          j        d¦  «        }t          j	        | |¦  «         t          |d         t           j        k    ¦  «         t          j        d|d         ¦  «        }t          j        |¦  «        }t          j        |¦  «        }t          j        |d         ¦  «         |S )a]  
    Retrieve the time value of an ASN1 time object.

    @param timestamp: An ASN1_GENERALIZEDTIME* (or an object safely castable to
        that type) from which the time value will be retrieved.

    @return: The time value from C{timestamp} as a L{bytes} string in a certain
        format.  Or C{None} if the object contains no time value.
    zASN1_STRING*r   NzASN1_GENERALIZEDTIME**)rI   ÚcastrD   ÚASN1_STRING_lengthÚASN1_STRING_typeÚV_ASN1_GENERALIZEDTIMEÚstringÚASN1_STRING_get0_datarJ   ÚASN1_TIME_to_generalizedtimerM   rN   ÚASN1_GENERALIZEDTIME_free)rg   Ústring_timestampÚgeneralized_timestampÚstring_dataÚstring_results        r:   Ú_get_asn1_timeru   Ã   sý   € õ ”y °Ñ;Ô;ÐÝÔÐ/Ñ0Ô0°AÒ5Ð5ØˆtåÔÐ.Ñ/Ô/µ4Ô3NÒNÐNåŒ{�4Ô5Ð6FÑGÔGÑHÔHÐHå $¤Ð)AÑ BÔ BÐÝÔ)¨)Ð5JÑKÔKÐKÝÐ-¨aÔ0µD´IÒ=Ñ>Ô>Ð>åœ9 ^Ð5JÈ1Ô5MÑNÔNÐÝÔ0Ð1AÑBÔBˆÝœ KÑ0Ô0ˆÝÔ&Ð'<¸QÔ'?Ñ@Ô@Ð@ØÐr9   c                  ó&   — e Zd Zd	d„Zd
d„Zd	d„ZdS )Ú_X509NameInvalidatorr=   rZ   c                ó   — g | _         d S rC   )Ú_names©Úselfs    r:   Ú__init__z_X509NameInvalidator.__init__á   s   € Ø&(ˆŒˆˆr9   Únamer#   c                ó:   — | j                              |¦  «         d S rC   )ry   Úappend©r{   r}   s     r:   Úaddz_X509NameInvalidator.addä   s   € ØŒ×Ò˜4Ñ Ô Ð Ð Ð r9   c                ó   — | j         D ]}|`Œd S rC   )ry   Ú_namer€   s     r:   Úclearz_X509NameInvalidator.clearç   s$   € Ø”Kð 	ð 	ˆDà�
�
ð	ð 	r9   N©r=   rZ   ©r}   r#   r=   rZ   )r4   r5   r6   r|   r�   r„   r8   r9   r:   rw   rw   à   sP   € € € € € ð)ð )ð )ð )ð!ð !ð !ð !ðð ð ð ð ð r9   rw   c                  ó¦   — e Zd ZdZdZdZdd„Zdd„Zedd
„¦   «         Z	 e
d¦  «        dd„¦   «         Z e
d¦  «        dd„¦   «         Zdd„Zdd„ZdS )r"   zD
    A class representing an DSA or RSA public key or key pair.
    FTr=   rZ   c                ó‚   — t          j        ¦   «         }t          j        |t           j        ¦  «        | _        d| _        d S )NF)rD   ÚEVP_PKEY_newrI   rO   ÚEVP_PKEY_freeÚ_pkeyÚ_initialized©r{   Úpkeys     r:   r|   zPKey.__init__õ   s4   € ÝÔ Ñ"Ô"ˆÝ”W˜T¥4Ô#5Ñ6Ô6ˆŒ
Ø!ˆÔÐÐr9   Ú_Keyc                ó  — ddl m}m} | j        r8t	          t
          | ¦  «        }t          j        t           ||¦  «        ¦  «        S t          t
          | ¦  «        }t          j        t           ||d¬¦  «        ¦  «        S )a  
        Export as a ``cryptography`` key.

        :rtype: One of ``cryptography``'s `key interfaces`_.

        .. _key interfaces: https://cryptography.io/en/latest/hazmat/            primitives/asymmetric/rsa/#key-interfaces

        .. versionadded:: 16.1.0
        r   )Úload_der_private_keyÚload_der_public_keyN)Úpassword)
Ú,cryptography.hazmat.primitives.serializationr‘   r’   Ú_only_publicr*   r   Útypingri   r�   Ú_dump_privatekey_internal)r{   r‘   r’   Úders       r:   Úto_cryptography_keyzPKey.to_cryptography_keyú   s—   € ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð
 Ôð 	OÝ ¥°Ñ5Ô5ˆCÝ”;�tÐ%8Ð%8¸Ñ%=Ô%=Ñ>Ô>Ð>å+­M¸4Ñ@Ô@ˆCÝ”;�tÐ%9Ð%9¸#ÈÐ%MÑ%MÔ%MÑNÔNÐNr9   Ú
crypto_keyc                ó¤  — t          |t          j        t          j        t          j        t          j        t          j        t          j	        t          j        t          j        t          j        t          j        f
¦  «        st!          d¦  «        ‚ddlm}m}m}m} t          |t          j        t          j        t          j	        t          j        t          j        f¦  «        r3t-          t.          |                     |j        |j        ¦  «        ¦  «        S |                     |j        |j         |¦   «         ¦  «        }t;          t.          |¦  «        S )zø
        Construct based on a ``cryptography`` *crypto_key*.

        :param crypto_key: A ``cryptography`` key.
        :type crypto_key: One of ``cryptography``'s `key interfaces`_.

        :rtype: PKey

        .. versionadded:: 16.1.0
        zUnsupported key typer   )ÚEncodingÚNoEncryptionÚPrivateFormatÚPublicFormat)r\   r   ÚDSAPrivateKeyÚDSAPublicKeyr   ÚEllipticCurvePrivateKeyÚEllipticCurvePublicKeyr   ÚEd25519PrivateKeyÚEd25519PublicKeyr   ÚEd448PrivateKeyÚEd448PublicKeyr   ÚRSAPrivateKeyÚRSAPublicKeyr]   r”   rœ   r�   rž   rŸ   r/   r   Úpublic_bytesÚDERÚSubjectPublicKeyInfoÚprivate_bytesÚPKCS8r.   )Úclsrš   rœ   r�   rž   rŸ   r˜   s          r:   Úfrom_cryptography_keyzPKey.from_cryptography_key  sP  € õ ØåÔ!ÝÔ ÝÔ*ÝÔ)ÝÔ)ÝÔ(ÝÔ%ÝÔ$ÝÔ!ÝÔ ðñ
ô 
ð 	4õ Ð2Ñ3Ô3Ð3ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
õ ØåÔ ÝÔ)ÝÔ(ÝÔ$ÝÔ ðñ	
ô 	
ð 	7õ "ÝØ×'Ò'Ø”L ,Ô"Cñô ñô ð ð ×*Ò*Ø”˜mÔ1°<°<±>´>ñô ˆCõ #¥=°#Ñ6Ô6Ð6r9   z`PKey.generate_key is deprecated. You should use the key generation APIs in cryptography instead.Útyper0   Úbitsc           	     ó�  — t          |t          ¦  «        st          d¦  «        ‚t          |t          ¦  «        st          d¦  «        ‚|t          k    rÜ|dk    rt	          d¦  «        ‚t          j        ¦   «         }t          j        |t
          j	        ¦  «        }t          j
        |t
          j        ¦  «         t          j        ¦   «         }t          j        |||t          j        ¦  «        }t          |dk    ¦  «         t          j        | j        |¦  «        }t          |dk    ¦  «         �n|t$          k    rõt          j        ¦   «         }t          |t          j        k    ¦  «         t          j        |t
          j        ¦  «        }t          j        ||t          j        dt          j        t          j        t          j        ¦  «        }t          |dk    ¦  «         t          t          j        |¦  «        dk    ¦  «         t          t          j        | j        |¦  «        dk    ¦  «         nt1          d¦  «        ‚d| _        dS )	a3  
        Generate a key pair of the given type, with the given number of bits.

        This generates a key "into" the this object.

        :param type: The key type.
        :type type: :py:data:`TYPE_RSA` or :py:data:`TYPE_DSA`
        :param bits: The number of bits.
        :type bits: :py:data:`int` ``>= 0``
        :raises TypeError: If :py:data:`type` or :py:data:`bits` isn't
            of the appropriate type.
        :raises ValueError: If the number of bits isn't an integer of
            the appropriate size.
        :return: ``None``
        ztype must be an integerzbits must be an integerr   zInvalid number of bitsé   zNo such key typeTN)r\   r0   r]   r   r_   rD   ÚBN_newrI   rO   ÚBN_freeÚBN_set_wordÚRSA_F4ÚRSA_newÚRSA_generate_key_exrN   rM   ÚEVP_PKEY_assign_RSAr‹   r   ÚDSA_newÚDSA_freeÚDSA_generate_parameters_exÚDSA_generate_keyÚEVP_PKEY_set1_DSAr!   rŒ   )r{   r±   r²   Úexponentr   Úresultr   Úress           r:   Úgenerate_keyzPKey.generate_keyK  s×  € õ( ˜$¥Ñ$Ô$ð 	7ÝÐ5Ñ6Ô6Ð6å˜$¥Ñ$Ô$ð 	7ÝÐ5Ñ6Ô6Ð6à•8ÒÐØ�qŠyˆyÝ Ð!9Ñ:Ô:Ð:õ ”{‘}”}ˆHÝ”w˜x­¬Ñ6Ô6ˆHÝÔ˜X¥t¤{Ñ3Ô3Ð3å”,‘.”.ˆCåÔ-¨c°4¸Å4Ä9ÑMÔMˆFÝ˜F ašKÑ(Ô(Ð(åÔ-¨d¬j¸#Ñ>Ô>ˆFÝ˜F ašKÑ(Ô(Ð(Ñ(à•XÒÐÝ”,‘.”.ˆCÝ˜C¥4¤9Ò,Ñ-Ô-Ð-å”'˜#�tœ}Ñ-Ô-ˆCÝÔ1Ø�T�4œ9 a­¬µD´I½t¼yñô ˆCõ ˜C 1šHÑ%Ô%Ð%å�DÔ1°#Ñ6Ô6¸!Ò;Ñ<Ô<Ð<Ý�DÔ2°4´:¸sÑCÔCÀqÒHÑIÔIÐIÐIåÐ*Ñ+Ô+Ð+à ˆÔÐÐr9   zJPKey.check is deprecated. You should use the APIs in cryptography instead.Úboolc                ó|  — | j         rt          d¦  «        ‚t          j        |                      ¦   «         ¦  «        t          j        k    rt          d¦  «        ‚t          j        | j        ¦  «        }t          j	        |t          j
        ¦  «        }t          j        |¦  «        }|dk    rdS t          ¦   «          dS )ax  
        Check the consistency of an RSA private key.

        This is the Python equivalent of OpenSSL's ``RSA_check_key``.

        :return: ``True`` if key is consistent.

        :raise OpenSSL.crypto.Error: if the key is inconsistent.

        :raise TypeError: if the key is of a type which cannot be checked.
            Only RSA keys can currently be checked.
        zpublic key onlyz'Only RSA keys can currently be checked.r´   TN)r•   r]   rD   ÚEVP_PKEY_typer±   ÚEVP_PKEY_RSAÚEVP_PKEY_get1_RSAr‹   rI   rO   ÚRSA_freeÚRSA_check_keyÚ_raise_current_error)r{   r   rÂ   s      r:   Úcheckz
PKey.check‡  s£   € ð" Ôð 	/ÝÐ-Ñ.Ô.Ð.åÔ˜dŸiši™kœkÑ*Ô*­dÔ.?Ò?Ð?ÝÐEÑFÔFÐFåÔ$ T¤ZÑ0Ô0ˆÝŒg�c�4œ=Ñ)Ô)ˆÝÔ# CÑ(Ô(ˆØ�QŠ;ˆ;Ø�4ÝÑÔÐÐÐr9   c                ó4   — t          j        | j        ¦  «        S )zT
        Returns the type of the key

        :return: The type of the key.
        )rD   ÚEVP_PKEY_idr‹   rz   s    r:   r±   z	PKey.type¥  s   € õ Ô ¤
Ñ+Ô+Ð+r9   c                ó4   — t          j        | j        ¦  «        S )zh
        Returns the number of bits of the key

        :return: The number of bits of the key.
        )rD   ÚEVP_PKEY_bitsr‹   rz   s    r:   r²   z	PKey.bits­  s   € õ Ô! $¤*Ñ-Ô-Ð-r9   Nr…   )r=   r�   )rš   r�   r=   r"   )r±   r0   r²   r0   r=   rZ   ©r=   rÅ   ©r=   r0   )r4   r5   r6   r7   r•   rŒ   r|   r™   Úclassmethodr°   r   rÄ   rÍ   r±   r²   r8   r9   r:   r"   r"   í   s  € € € € € ðð ð €LØ€Lð"ð "ð "ð "ð
Oð Oð Oð Oð. ð77ð 77ð 77ñ „[ð77ðr €Zð	3ñô ð6!ð 6!ð 6!ñ	ô ð6!ðp €Zð	 ñô ðð ð ñ	ô ðð4,ð ,ð ,ð ,ð.ð .ð .ð .ð .ð .r9   r"   c                  óˆ   ‡ — e Zd ZdZdZdˆ fd„Zedd
„¦   «         Zedd„¦   «         Zedd„¦   «         Z	dd„Z
dd„Zdd„Zˆ xZS )Ú_EllipticCurveaZ  
    A representation of a supported elliptic curve.

    @cvar _curves: :py:obj:`None` until an attempt is made to load the curves.
        Thereafter, a :py:type:`set` containing :py:type:`_EllipticCurve`
        instances each of which represents one curve supported by the system.
    @type _curves: :py:type:`NoneType` or :py:type:`set`
    NÚotherr   r=   rÅ   c                ó~   •— t          |t          ¦  «        r!t          ¦   «                              |¦  «        S t          S )z·
        Implement cooperation with the right-hand side argument of ``!=``.

        Python 3 seems to have dropped this cooperation in this very narrow
        circumstance.
        )r\   rÖ   ÚsuperÚ__ne__ÚNotImplemented)r{   r×   Ú	__class__s     €r:   rÚ   z_EllipticCurve.__ne__Â  s3   ø€ õ �e�^Ñ,Ô,ð 	)Ý‘7”7—>’> %Ñ(Ô(Ð(ÝÐr9   r   úset[_EllipticCurve]c                óÔ   ‡ ‡— ‰                      t          j        d¦  «        }t          j        d|¦  «        }‰                      ||¦  «         t	          ˆ ˆfd„|D ¦   «         ¦  «        S )zü
        Get the curves supported by OpenSSL.

        :param lib: The OpenSSL library binding object.

        :return: A :py:type:`set` of ``cls`` instances giving the names of the
            elliptic curves the underlying library supports.
        r   zEC_builtin_curve[]c              3  óN   •K  — | ]}‰                      ‰|j        ¦  «        V — Œ d S rC   )Úfrom_nidÚnid)Ú.0Úcr¯   r   s     €€r:   ú	<genexpr>z7_EllipticCurve._load_elliptic_curves.<locals>.<genexpr>Ý  s3   øè è € ÐDÐD°�3—<’<  Q¤UÑ+Ô+ÐDÐDÐDÐDÐDÐDr9   )ÚEC_get_builtin_curvesrI   rN   rJ   Úset)r¯   r   Ú
num_curvesÚbuiltin_curvess   ``  r:   Ú_load_elliptic_curvesz$_EllipticCurve._load_elliptic_curvesÍ  sm   øø€ ð ×.Ò.­t¬y¸!Ñ<Ô<ˆ
ÝœÐ"6¸
ÑCÔCˆð 	×!Ò! .°*Ñ=Ô=Ð=ÝÐDÐDÐDÐDÐD°^ÐDÑDÔDÑDÔDÐDr9   c                óR   — | j         €|                      |¦  «        | _         | j         S )a  
        Get, cache, and return the curves supported by OpenSSL.

        :param lib: The OpenSSL library binding object.

        :return: A :py:type:`set` of ``cls`` instances giving the names of the
            elliptic curves the underlying library supports.
        )Ú_curvesré   )r¯   r   s     r:   Ú_get_elliptic_curvesz#_EllipticCurve._get_elliptic_curvesß  s)   € ð Œ;ÐØ×3Ò3°CÑ8Ô8ˆCŒKØŒ{Ðr9   rá   r0   c           	     óŒ   —  | ||t          j        |                     |¦  «        ¦  «                             d¦  «        ¦  «        S )aË  
        Instantiate a new :py:class:`_EllipticCurve` associated with the given
        OpenSSL NID.

        :param lib: The OpenSSL library binding object.

        :param nid: The OpenSSL NID the resulting curve object will represent.
            This must be a curve NID (and not, for example, a hash NID) or
            subsequent operations will fail in unpredictable ways.
        :type nid: :py:class:`int`

        :return: The curve object.
        Úascii)rI   rm   Ú
OBJ_nid2snÚdecode)r¯   r   rá   s      r:   rà   z_EllipticCurve.from_nidí  s<   € ð ˆs�3˜�Tœ[¨¯ª¸Ñ)<Ô)<Ñ=Ô=×DÒDÀWÑMÔMÑNÔNÐNr9   r}   ÚstrrZ   c                ó0   — || _         || _        || _        dS )a‰  
        :param _lib: The :py:mod:`cryptography` binding instance used to
            interface with OpenSSL.

        :param _nid: The OpenSSL NID identifying the curve this object
            represents.
        :type _nid: :py:class:`int`

        :param name: The OpenSSL short name identifying the curve this object
            represents.
        :type name: :py:class:`unicode`
        N)rD   Ú_nidr}   )r{   r   rá   r}   s       r:   r|   z_EllipticCurve.__init__þ  s   € ð ˆŒ	ØˆŒ	ØˆŒ	ˆ	ˆ	r9   c                ó   — d| j         ›d�S )Nz<Curve ú>©r}   rz   s    r:   Ú__repr__z_EllipticCurve.__repr__  s   € Ø'˜œÐ'Ð'Ð'Ð'r9   c                ó~   — | j                              | j        ¦  «        }t          j        |t           j        ¦  «        S )zÅ
        Create a new OpenSSL EC_KEY structure initialized to use this curve.

        The structure is automatically garbage collected when the Python object
        is garbage collected.
        )rD   ÚEC_KEY_new_by_curve_nameró   rI   rO   ÚEC_KEY_free)r{   Úkeys     r:   Ú
_to_EC_KEYz_EllipticCurve._to_EC_KEY  s0   € ð Œi×0Ò0°´Ñ;Ô;ˆÝŒw�s�DÔ,Ñ-Ô-Ð-r9   ©r×   r   r=   rÅ   )r   r   r=   rÝ   )r   r   rá   r0   r=   rÖ   )r   r   rá   r0   r}   rñ   r=   rZ   ©r=   rñ   ©r=   r   )r4   r5   r6   r7   rë   rÚ   rÔ   ré   rì   rà   r|   r÷   rü   Ú__classcell__©rÜ   s   @r:   rÖ   rÖ   ¶  sò   ø€ € € € € ðð ð €Gð	ð 	ð 	ð 	ð 	ð 	ð ðEð Eð Eñ „[ðEð" ðð ð ñ „[ðð ðOð Oð Oñ „[ðOð ð ð ð ð"(ð (ð (ð (ð.ð .ð .ð .ð .ð .ð .ð .r9   rÖ   zSget_elliptic_curves is deprecated. You should use the APIs in cryptography instead.rÝ   c                 ó@   — t                                t          ¦  «        S )a“  
    Return a set of objects representing the elliptic curves supported in the
    OpenSSL build in use.

    The curve objects have a :py:class:`unicode` ``name`` attribute by which
    they identify themselves.

    The curve objects are useful as values for the argument accepted by
    :py:meth:`Context.set_tmp_ecdh` to specify which elliptical curve should be
    used for ECDHE key exchange.
    )rÖ   rì   rD   r8   r9   r:   r,   r,     s   € õ  ×.Ò.­tÑ4Ô4Ð4r9   zRget_elliptic_curve is deprecated. You should use the APIs in cryptography instead.r}   rñ   c                ób   — t          ¦   «         D ]}|j        | k    r|c S Œt          d| ¦  «        ‚)aT  
    Return a single curve object selected by name.

    See :py:func:`get_elliptic_curves` for information about curve objects.

    :param name: The OpenSSL short name identifying the curve object to
        retrieve.
    :type name: :py:class:`unicode`

    If the named curve is not supported then :py:class:`ValueError` is raised.
    zunknown curve name)r,   r}   r_   )r}   Úcurves     r:   r+   r+   0  sE   € õ  %Ñ&Ô&ð ð ˆØŒ:˜ÒÐØˆLˆLˆLð å
Ð)¨4Ñ
0Ô
0Ð0r9   zUX509Name support in pyOpenSSL is deprecated. You should use the APIs in cryptography.c                  ód   ‡ — e Zd ZdZdd„Zdˆ fd	„Zdd„Zdd„Zdd„Zdd„Z	dd„Z
dd„Zdd„Zˆ xZS )r#   a  
    An X.509 Distinguished Name.

    :ivar countryName: The country of the entity.
    :ivar C: Alias for  :py:attr:`countryName`.

    :ivar stateOrProvinceName: The state or province of the entity.
    :ivar ST: Alias for :py:attr:`stateOrProvinceName`.

    :ivar localityName: The locality of the entity.
    :ivar L: Alias for :py:attr:`localityName`.

    :ivar organizationName: The organization name of the entity.
    :ivar O: Alias for :py:attr:`organizationName`.

    :ivar organizationalUnitName: The organizational unit of the entity.
    :ivar OU: Alias for :py:attr:`organizationalUnitName`

    :ivar commonName: The common name of the entity.
    :ivar CN: Alias for :py:attr:`commonName`.

    :ivar emailAddress: The e-mail address of the entity.
    r}   r=   rZ   c                ó€   — t          j        |j        ¦  «        }t          j        |t           j        ¦  «        | _        dS )zž
        Create a new X509Name, copying the given X509Name instance.

        :param name: The name to copy.
        :type name: :py:class:`X509Name`
        N)rD   ÚX509_NAME_duprƒ   rI   rO   ÚX509_NAME_freer€   s     r:   r|   zX509Name.__init__d  s0   € õ Ô! $¤*Ñ-Ô-ˆÝœ' $­Ô(;Ñ<Ô<ˆŒ
ˆ
ˆ
r9   rñ   Úvaluer   c           	     óÔ  •— |                      d¦  «        r"t          ¦   «                              ||¦  «        S t          |¦  «        t          ur&t          dt          |¦  «        j        d›d�¦  «        ‚t          j        t          |¦  «        ¦  «        }|t          j
        k    r/	 t          ¦   «          n# t          $ r Y nw xY wt          d¦  «        ‚t          t          j        | j        ¦  «        ¦  «        D ]z}t          j        | j        |¦  «        }t          j        |¦  «        }t          j        |¦  «        }||k    r0t          j        | j        |¦  «        }t          j        |¦  «          nŒ{t-          |t          ¦  «        r|                     d¦  «        }t          j        | j        |t          j        |t5          |¦  «        dd¦  «        }|st          ¦   «          d S d S )	NÚ_z$attribute name must be string, not 'z.200ú'úNo such attributeúutf-8éÿÿÿÿr   )Ú
startswithrÙ   Ú__setattr__r±   rñ   r]   r4   rD   ÚOBJ_txt2nidÚ_byte_stringÚ	NID_undefrÌ   r!   ÚAttributeErrorÚrangeÚX509_NAME_entry_countrƒ   ÚX509_NAME_get_entryÚX509_NAME_ENTRY_get_objectÚOBJ_obj2nidÚX509_NAME_delete_entryÚX509_NAME_ENTRY_freer\   ÚencodeÚX509_NAME_add_entry_by_NIDÚMBSTRING_UTF8rL   )
r{   r}   r	  rá   ÚiÚentÚent_objÚent_nidÚ
add_resultrÜ   s
            €r:   r  zX509Name.__setattr__n  sì  ø€ Ø�?Š?˜3ÑÔð 	4Ý‘7”7×&Ò& t¨UÑ3Ô3Ð3õ �‰:Œ:�SÐ Ð Ýð1Ý˜‘K”KÔ(Ð0ð1ð 1ð 1ñô ð õ
 Ô�|¨DÑ1Ô1Ñ2Ô2ˆØ•$”.Ò Ð ðÝ$Ñ&Ô&Ð&Ð&øÝð ð ð Ø�ðøøøå Ð!4Ñ5Ô5Ð5õ •tÔ1°$´*Ñ=Ô=Ñ>Ô>ð 	ð 	ˆAÝÔ*¨4¬:°qÑ9Ô9ˆCÝÔ5°cÑ:Ô:ˆGÝÔ& wÑ/Ô/ˆGØ�gŠ~ˆ~ÝÔ1°$´*¸aÑ@Ô@�ÝÔ)¨#Ñ.Ô.Ð.Ø�ð õ
 �e�SÑ!Ô!ð 	*Ø—L’L Ñ)Ô)ˆEåÔ4ØŒJ˜�TÔ/°½¸E¹
¼
ÀBÈñ
ô 
ˆ
ð ð 	#Ý Ñ"Ô"Ð"Ð"Ð"ð	#ð 	#s   Â'B6 Â6
CÃCú
str | Nonec                óÂ  — t          j        t          |¦  «        ¦  «        }|t           j        k    r/	 t	          ¦   «          n# t
          $ r Y nw xY wt          d¦  «        ‚t          j        | j        |d¦  «        }|dk    rdS t          j	        | j        |¦  «        }t          j
        |¦  «        }t          j        d¦  «        }t          j        ||¦  «        }t          |dk    ¦  «         	 t          j        |d         |¦  «        dd…                              d¦  «        }t          j        |d         ¦  «         n# t          j        |d         ¦  «         w xY w|S )a
  
        Find attribute. An X509Name object has the following attributes:
        countryName (alias C), stateOrProvince (alias ST), locality (alias L),
        organization (alias O), organizationalUnit (alias OU), commonName
        (alias CN) and more...
        r  r  Núunsigned char**r   r  )rD   r  r  r  rÌ   r!   r  ÚX509_NAME_get_index_by_NIDrƒ   r  ÚX509_NAME_ENTRY_get_datarI   rJ   ÚASN1_STRING_to_UTF8rM   r;   rð   ÚOPENSSL_free)	r{   r}   rá   Úentry_indexÚentryrP   rU   Údata_lengthrÂ   s	            r:   Ú__getattr__zX509Name.__getattr__•  s^  € õ Ô�|¨DÑ1Ô1Ñ2Ô2ˆØ•$”.Ò Ð ðÝ$Ñ&Ô&Ð&Ð&øÝð ð ð Ø�ðøøøå Ð!4Ñ5Ô5Ð5åÔ5°d´jÀ#ÀrÑJÔJˆØ˜"ÒÐØ�4åÔ(¨¬°[ÑAÔAˆÝÔ,¨UÑ3Ô3ˆåœÐ!2Ñ3Ô3ˆÝÔ.¨}¸dÑCÔCˆÝ˜ qÒ(Ñ)Ô)Ð)ð	0Ý”[ ¨qÔ!1°;Ñ?Ô?ÀÀÀÔB×IÒIØñô ˆFõ
 Ô˜m¨AÔ.Ñ/Ô/Ð/Ð/ø�DÔ˜m¨AÔ.Ñ/Ô/Ð/Ð/øøøØˆs   ³A Á
AÁAÃ/6E  Å Er×   rÅ   c                ó€   — t          |t          ¦  «        st          S t          j        | j        |j        ¦  «        dk    S ©Nr   ©r\   r#   rÛ   rD   ÚX509_NAME_cmprƒ   ©r{   r×   s     r:   Ú__eq__zX509Name.__eq__½  s6   € Ý˜%¥Ñ*Ô*ð 	"Ý!Ð!åÔ! $¤*¨e¬kÑ:Ô:¸aÒ?Ð?r9   c                ó€   — t          |t          ¦  «        st          S t          j        | j        |j        ¦  «        dk     S r1  r2  r4  s     r:   Ú__lt__zX509Name.__lt__Ã  s6   € Ý˜%¥Ñ*Ô*ð 	"Ý!Ð!åÔ! $¤*¨e¬kÑ:Ô:¸QÒ>Ð>r9   c                ó*  — t          j        dd¦  «        }t          j        | j        |t          |¦  «        ¦  «        }t          |t           j        k    ¦  «         d                     t          j	        |¦  «         
                    d¦  «        ¦  «        S )z6
        String representation of an X509Name
        r?   i   z<X509Name object '{}'>r  )rI   rJ   rD   ÚX509_NAME_onelinerƒ   rL   rM   rN   Úformatrm   rð   )r{   rU   Úformat_results      r:   r÷   zX509Name.__repr__É  s‚   € õ œ ¨3Ñ/Ô/ˆÝÔ.ØŒJ˜¥s¨=Ñ'9Ô'9ñ
ô 
ˆõ 	˜­¬Ò2Ñ3Ô3Ð3à'×.Ò.ÝŒK˜Ñ&Ô&×-Ò-¨gÑ6Ô6ñ
ô 
ð 	
r9   r0   c                ó4   — t          j        | j        ¦  «        S )a&  
        Return an integer representation of the first four bytes of the
        MD5 digest of the DER representation of the name.

        This is the Python equivalent of OpenSSL's ``X509_NAME_hash``.

        :return: The (integer) hash of this name.
        :rtype: :py:class:`int`
        )rD   ÚX509_NAME_hashrƒ   rz   s    r:   ÚhashzX509Name.hash×  s   € õ Ô" 4¤:Ñ.Ô.Ð.r9   rR   c                ó  — t          j        d¦  «        }t          j        | j        |¦  «        }t          |dk    ¦  «         t          j        |d         |¦  «        dd…         }t          j        |d         ¦  «         |S )zŽ
        Return the DER encoding of this name.

        :return: The DER encoded form of this name.
        :rtype: :py:class:`bytes`
        r'  r   N)rI   rJ   rD   Úi2d_X509_NAMErƒ   rM   r;   r+  )r{   rU   Úencode_resultrt   s       r:   r˜   zX509Name.derã  sv   € õ œÐ!2Ñ3Ô3ˆÝÔ*¨4¬:°}ÑEÔEˆÝ˜¨Ò*Ñ+Ô+Ð+åœ M°!Ô$4°mÑDÔDÀQÀQÀQÔGˆÝÔ˜-¨Ô*Ñ+Ô+Ð+ØÐr9   úlist[tuple[bytes, bytes]]c                ó  — g }t          t          j        | j        ¦  «        ¦  «        D ]Ö}t          j        | j        |¦  «        }t          j        |¦  «        }t          j        |¦  «        }t          j        |¦  «        }t          j        |¦  «        }t          j
        t          j        |¦  «        t          j        |¦  «        ¦  «        dd…         }|                     t          j        |¦  «        |f¦  «         Œ×|S )z¼
        Returns the components of this name, as a sequence of 2-tuples.

        :return: The components of this name.
        :rtype: :py:class:`list` of ``name, value`` tuples.
        N)r  rD   r  rƒ   r  r  r)  r  rï   rI   r;   rn   rj   r   rm   )	r{   rÂ   r   r!  ÚfnameÚfvalrá   r}   r	  s	            r:   Úget_componentszX509Name.get_componentsò  så   € ð ˆÝ•tÔ1°$´*Ñ=Ô=Ñ>Ô>ð 	6ð 	6ˆAÝÔ*¨4¬:°qÑ9Ô9ˆCåÔ3°CÑ8Ô8ˆEÝÔ0°Ñ5Ô5ˆDåÔ" 5Ñ)Ô)ˆCÝ”? 3Ñ'Ô'ˆDõ ”KÝÔ*¨4Ñ0Ô0µ$Ô2IÈ$Ñ2OÔ2Oñô àˆaˆaôˆEð �MŠM�4œ; tÑ,Ô,¨eÐ4Ñ5Ô5Ð5Ð5àˆr9   r†   )r}   rñ   r	  r   r=   rZ   )r}   rñ   r=   r%  rý   rþ   rÓ   ©r=   rR   )r=   rB  )r4   r5   r6   r7   r|   r  r/  r5  r7  r÷   r>  r˜   rF  r   r  s   @r:   r#   r#   F  sí   ø€ € € € € ðð ð0=ð =ð =ð =ð%#ð %#ð %#ð %#ð %#ð %#ðN&ð &ð &ð &ðP@ð @ð @ð @ð?ð ?ð ?ð ?ð
ð 
ð 
ð 
ð
/ð 
/ð 
/ð 
/ðð ð ð ðð ð ð ð ð ð ð r9   r#   c                  óº  — e Zd ZdZdFd„ZedGd„¦   «         ZdHd	„ZedId„¦   «         Z e	d¦  «        dJd„¦   «         Z
dKd„ZdLd„Z e	d¦  «        dMd„¦   «         Z e	d¦  «        dNd„¦   «         ZdOd„ZdPd„ZdKd„Z e	d¦  «        dQd!„¦   «         ZdKd"„Z e	d#¦  «        dRd%„¦   «         Z e	d&¦  «        dRd'„¦   «         ZdSd)„ZdTd,„ZdUd-„ZdVd0„Z e	d1¦  «        dWd2„¦   «         ZdUd3„Z e	d4¦  «        dWd5„¦   «         ZdXd7„ZdYd9„Z e	d:¦  «        dZd;„¦   «         Z e	d<¦  «        d[d>„¦   «         Z  e	d?¦  «        dZd@„¦   «         Z! e	dA¦  «        d\dC„¦   «         Z"dKdD„Z#dES )]r    z
    An X.509 certificate.
    r=   rZ   c                óú   — t          j        ¦   «         }t          |t          j        k    ¦  «         t          j        |t           j        ¦  «        | _        t          ¦   «         | _	        t          ¦   «         | _
        d S rC   )rD   ÚX509_newrM   rI   rN   rO   Ú	X509_freeÚ_x509rw   Ú_issuer_invalidatorÚ_subject_invalidator)r{   r   s     r:   r|   zX509.__init__  sY   € ÝŒ}‰ŒˆÝ˜¥¤	Ò)Ñ*Ô*Ð*Ý”W˜T¥4¤>Ñ2Ô2ˆŒ
å#7Ñ#9Ô#9ˆÔ Ý$8Ñ$:Ô$:ˆÔ!Ð!Ð!r9   r   r   c                óÄ   — |                       | ¦  «        }t          j        |t          j        ¦  «        |_        t          ¦   «         |_        t          ¦   «         |_        |S rC   )	Ú__new__rI   rO   rD   rK  rL  rw   rM  rN  )r¯   r   Úcerts      r:   Ú_from_raw_x509_ptrzX509._from_raw_x509_ptr  sI   € à�{Š{˜3ÑÔˆÝ”W˜T¥4¤>Ñ2Ô2ˆŒ
Ý#7Ñ#9Ô#9ˆÔ Ý$8Ñ$:Ô$:ˆÔ!Øˆr9   úx509.Certificatec                óN   — ddl m} t          t          | ¦  «        } ||¦  «        S )z�
        Export as a ``cryptography`` certificate.

        :rtype: ``cryptography.x509.Certificate``

        .. versionadded:: 17.1.0
        r   )Úload_der_x509_certificate)Úcryptography.x509rU  r(   r   )r{   rU  r˜   s      r:   Úto_cryptographyzX509.to_cryptography"  s7   € ð 	@Ð?Ð?Ð?Ð?Ð?å�}¨dÑ3Ô3ˆØ(Ð(¨Ñ-Ô-Ð-r9   Úcrypto_certc                ó¾   — t          |t          j        ¦  «        st          d¦  «        ‚ddlm} |                     |j        ¦  «        }t          t          |¦  «        S )zü
        Construct based on a ``cryptography`` *crypto_cert*.

        :param crypto_key: A ``cryptography`` X.509 certificate.
        :type crypto_key: ``cryptography.x509.Certificate``

        :rtype: X509

        .. versionadded:: 17.1.0
        zMust be a certificater   ©rœ   )
r\   r   ÚCertificater]   r”   rœ   rª   r«   r-   r   )r¯   rX  rœ   r˜   s       r:   Úfrom_cryptographyzX509.from_cryptography/  s_   € õ ˜+¥tÔ'7Ñ8Ô8ð 	5ÝÐ3Ñ4Ô4Ð4àIÐIÐIÐIÐIÐIà×&Ò& x¤|Ñ4Ô4ˆÝ¥¨sÑ3Ô3Ð3r9   zYX509.set_version is deprecated. You should use cryptography's CertificateBuilder instead.Úversionr0   c                ó¤   — t          |t          ¦  «        st          d¦  «        ‚t          t	          j        | j        |¦  «        dk    ¦  «         dS )a	  
        Set the version number of the certificate. Note that the
        version value is zero-based, eg. a value of 0 is V1.

        :param version: The version number of the certificate.
        :type version: :py:class:`int`

        :return: ``None``
        zversion must be an integerr´   N)r\   r0   r]   rM   rD   ÚX509_set_versionrL  )r{   r]  s     r:   Úset_versionzX509.set_versionC  sM   € õ ˜'¥3Ñ'Ô'ð 	:ÝÐ8Ñ9Ô9Ð9å�Ô-¨d¬j¸'ÑBÔBÀaÒGÑHÔHÐHÐHÐHr9   c                ó4   — t          j        | j        ¦  «        S )z˜
        Return the version number of the certificate.

        :return: The version number of the certificate.
        :rtype: :py:class:`int`
        )rD   ÚX509_get_versionrL  rz   s    r:   Úget_versionzX509.get_versionV  s   € õ Ô$ T¤ZÑ0Ô0Ð0r9   r"   c                ó&  — t                                t           ¦  «        }t          j        | j        ¦  «        |_        |j        t          j        k    rt          ¦   «          t          j	        |j        t          j
        ¦  «        |_        d|_        |S )z{
        Get the public key of the certificate.

        :return: The public key.
        :rtype: :py:class:`PKey`
        T)r"   rP  rD   ÚX509_get_pubkeyrL  r‹   rI   rN   rÌ   rO   rŠ   r•   r�   s     r:   Ú
get_pubkeyzX509.get_pubkey_  si   € õ �|Š|�DÑ!Ô!ˆÝÔ)¨$¬*Ñ5Ô5ˆŒ
ØŒ:�œÒ"Ð"Ý Ñ"Ô"Ð"Ý”W˜TœZ­Ô);Ñ<Ô<ˆŒ
Ø ˆÔØˆr9   zXX509.set_pubkey is deprecated. You should use cryptography's CertificateBuilder instead.rŽ   c                ó²   — t          |t          ¦  «        st          d¦  «        ‚t          j        | j        |j        ¦  «        }t          |dk    ¦  «         dS )z¥
        Set the public key of the certificate.

        :param pkey: The public key.
        :type pkey: :py:class:`PKey`

        :return: :py:data:`None`
        úpkey must be a PKey instancer´   N)r\   r"   r]   rD   ÚX509_set_pubkeyrL  r‹   rM   )r{   rŽ   r`   s      r:   Ú
set_pubkeyzX509.set_pubkeyn  sS   € õ ˜$¥Ñ%Ô%ð 	<ÝÐ:Ñ;Ô;Ð;åÔ)¨$¬*°d´jÑAÔAˆ
Ý˜
 ašÑ(Ô(Ð(Ð(Ð(r9   zRX509.sign is deprecated. You should use cryptography's CertificateBuilder instead.Údigestrñ   c                óŒ  — t          |t          ¦  «        st          d¦  «        ‚|j        rt	          d¦  «        ‚|j        st	          d¦  «        ‚t          j        t          |¦  «        ¦  «        }|t          j
        k    rt	          d¦  «        ‚t          j        | j        |j        |¦  «        }t          |dk    ¦  «         dS )a  
        Sign the certificate with this key and digest type.

        :param pkey: The key to sign with.
        :type pkey: :py:class:`PKey`

        :param digest: The name of the message digest to use.
        :type digest: :py:class:`str`

        :return: :py:data:`None`
        rh  zKey only has public partzKey is uninitializedúNo such digest methodr   N)r\   r"   r]   r•   r_   rŒ   rD   ÚEVP_get_digestbynamer  rI   rN   Ú	X509_signrL  r‹   rM   )r{   rŽ   rk  Úevp_mdÚsign_results        r:   Úsignz	X509.sign�  s¼   € õ  ˜$¥Ñ%Ô%ð 	<ÝÐ:Ñ;Ô;Ð;àÔð 	9ÝÐ7Ñ8Ô8Ð8àÔ ð 	5ÝÐ3Ñ4Ô4Ð4åÔ*­<¸Ñ+?Ô+?Ñ@Ô@ˆØ•T”YÒÐÝÐ4Ñ5Ô5Ð5å”n T¤Z°´¸VÑDÔDˆÝ˜ ašÑ(Ô(Ð(Ð(Ð(r9   rR   c                óp  — t          j        | j        ¦  «        }t          j        d¦  «        }t          j        |t          j        t          j        |¦  «         t          j        |d         ¦  «        }|t           j        k    rt          d¦  «        ‚t          j
        t          j        |¦  «        ¦  «        S )zþ
        Return the signature algorithm used in the certificate.

        :return: The name of the algorithm.
        :rtype: :py:class:`bytes`

        :raises ValueError: If the signature algorithm is undefined.

        .. versionadded:: 0.13
        zASN1_OBJECT **r   zUndefined signature algorithm)rD   ÚX509_get0_tbs_sigalgrL  rI   rJ   ÚX509_ALGOR_get0rN   r  r  r_   rm   Ú
OBJ_nid2ln)r{   Úsig_algÚalgrá   s       r:   Úget_signature_algorithmzX509.get_signature_algorithm¡  s‹   € õ Ô+¨D¬JÑ7Ô7ˆÝŒhÐ'Ñ(Ô(ˆÝÔ˜S¥$¤)­T¬Y¸Ñ@Ô@Ð@ÝÔ˜s 1œvÑ&Ô&ˆØ•$”.Ò Ð ÝÐ<Ñ=Ô=Ð=ÝŒ{�4œ?¨3Ñ/Ô/Ñ0Ô0Ð0r9   Údigest_namec                óÜ  — t          j        t          |¦  «        ¦  «        }|t          j        k    rt          d¦  «        ‚t          j        dt           j        ¦  «        }t          j        dd¦  «        }t          |¦  «        |d<   t          j	        | j
        |||¦  «        }t          |dk    ¦  «         d                     d„ t          j        ||d         ¦  «        D ¦   «         ¦  «        S )a5  
        Return the digest of the X509 object.

        :param digest_name: The name of the digest algorithm to use.
        :type digest_name: :py:class:`str`

        :return: The digest of the object, formatted as
            :py:const:`b":"`-delimited hex pairs.
        :rtype: :py:class:`bytes`
        rm  zunsigned char[]zunsigned int[]r´   r   ó   :c                óP   — g | ]#}t          |¦  «                             ¦   «         ‘Œ$S r8   )r   Úupper)râ   Úchs     r:   ú
<listcomp>zX509.digest.<locals>.<listcomp>Í  s:   € ð ð ð àõ ˜"‘”×#Ò#Ñ%Ô%ðð ð r9   )rD   rn  r  rI   rN   r_   rJ   ÚEVP_MAX_MD_SIZErL   ÚX509_digestrL  rM   Újoinr;   )r{   rz  rk  rU   Úresult_lengthÚdigest_results         r:   rk  zX509.digest´  sæ   € õ Ô*­<¸Ñ+DÔ+DÑEÔEˆØ•T”YÒÐÝÐ4Ñ5Ô5Ð5åœÐ!2µDÔ4HÑIÔIˆÝœÐ!1°1Ñ5Ô5ˆÝ˜}Ñ-Ô-ˆ�aÑåÔ(ØŒJ˜ ¨}ñ
ô 
ˆõ 	˜¨Ò*Ñ+Ô+Ð+à�yŠyðð åœ+ m°]À1Ô5EÑFÔFðñ ô ñ
ô 
ð 	
r9   c                ó4   — t          j        | j        ¦  «        S )z�
        Return the hash of the X509 subject.

        :return: The hash of the subject.
        :rtype: :py:class:`int`
        )rD   ÚX509_subject_name_hashrL  rz   s    r:   Úsubject_name_hashzX509.subject_name_hashÓ  s   € õ Ô*¨4¬:Ñ6Ô6Ð6r9   z_X509.set_serial_number is deprecated. You should use cryptography's CertificateBuilder instead.Úserialc                ó‚  — t          |t          ¦  «        st          d¦  «        ‚t          |¦  «        dd…         }|                     d¦  «        }t          j        d¦  «        }t          j        ||¦  «        }t          |t
          j
        k    ¦  «         t          j        |d         t
          j
        ¦  «        }t          j        |d         ¦  «         t          |t
          j
        k    ¦  «         t          j        |t          j        ¦  «        }t          j        | j        |¦  «        }t          |dk    ¦  «         dS )z±
        Set the serial number of the certificate.

        :param serial: The new serial number.
        :type serial: :py:class:`int`

        :return: :py:data`None`
        zserial must be an integeré   Nrî   zBIGNUM**r   r´   )r\   r0   r]   Úhexr  rI   rJ   rD   Ú	BN_hex2bnrM   rN   ÚBN_to_ASN1_INTEGERr¶   rO   ÚASN1_INTEGER_freeÚX509_set_serialNumberrL  )r{   r‰  Ú
hex_serialÚhex_serial_bytesÚbignum_serialrÂ   Úasn1_serialr`   s           r:   Úset_serial_numberzX509.set_serial_numberÜ  s  € õ ˜&¥#Ñ&Ô&ð 	9ÝÐ7Ñ8Ô8Ð8å˜‘[”[   ”_ˆ
Ø%×,Ò,¨WÑ5Ô5Ðåœ Ñ,Ô,ˆõ ” Ð/?Ñ@Ô@ˆÝ˜¥$¤)Ò+Ñ,Ô,Ð,åÔ-¨m¸AÔ.>ÅÄ	ÑJÔJˆÝŒ�] 1Ô%Ñ&Ô&Ð&Ý˜¥t¤yÒ0Ñ1Ô1Ð1Ý”g˜k­4Ô+AÑBÔBˆÝÔ/°´
¸KÑHÔHˆ
Ý˜
 ašÑ(Ô(Ð(Ð(Ð(r9   c                óž  — t          j        | j        ¦  «        }t          j        |t          j        ¦  «        }	 t          j        |¦  «        }	 t	          j        |¦  «        }t          |d¦  «        }|t          j	        |¦  «         t          j
        |¦  «         S # t          j	        |¦  «         w xY w# t          j
        |¦  «         w xY w)zx
        Return the serial number of this certificate.

        :return: The serial number.
        :rtype: int
        é   )rD   ÚX509_get_serialNumberrL  ÚASN1_INTEGER_to_BNrI   rN   Ú	BN_bn2hexrm   r0   r+  r¶   )r{   r”  r“  r‘  Úhexstring_serialr‰  s         r:   Úget_serial_numberzX509.get_serial_numberü  s»   € õ Ô0°´Ñ<Ô<ˆÝÔ/°½T¼YÑGÔGˆð		(Ýœ¨Ñ6Ô6ˆJð.Ý#'¤;¨zÑ#:Ô#:Ð ÝÐ-¨rÑ2Ô2�ØåÔ! *Ñ-Ô-Ð-åŒL˜Ñ'Ô'Ð'Ð'øõ Ô! *Ñ-Ô-Ð-Ð-øøøøåŒL˜Ñ'Ô'Ð'Ð'øøøs#   ºB6 Á%B Á4B6 ÂB3Â3B6 Â6CzaX509.gmtime_adj_notAfter is deprecated. You should use cryptography's CertificateBuilder instead.Úamountc                óª   — t          |t          ¦  «        st          d¦  «        ‚t          j        | j        ¦  «        }t          j        ||¦  «         dS )zÍ
        Adjust the time stamp on which the certificate stops being valid.

        :param int amount: The number of seconds by which to adjust the
            timestamp.
        :return: ``None``
        úamount must be an integerN)r\   r0   r]   rD   ÚX509_getm_notAfterrL  ÚX509_gmtime_adj)r{   r�  ÚnotAfters      r:   Úgmtime_adj_notAfterzX509.gmtime_adj_notAfter  sP   € õ ˜&¥#Ñ&Ô&ð 	9ÝÐ7Ñ8Ô8Ð8åÔ*¨4¬:Ñ6Ô6ˆÝÔ˜X vÑ.Ô.Ð.Ð.Ð.r9   zbX509.gmtime_adj_notBefore is deprecated. You should use cryptography's CertificateBuilder instead.c                óª   — t          |t          ¦  «        st          d¦  «        ‚t          j        | j        ¦  «        }t          j        ||¦  «         dS )z½
        Adjust the timestamp on which the certificate starts being valid.

        :param amount: The number of seconds by which to adjust the timestamp.
        :return: ``None``
        rŸ  N)r\   r0   r]   rD   ÚX509_getm_notBeforerL  r¡  )r{   r�  Ú	notBefores      r:   Úgmtime_adj_notBeforezX509.gmtime_adj_notBefore"  sP   € õ ˜&¥#Ñ&Ô&ð 	9ÝÐ7Ñ8Ô8Ð8åÔ,¨T¬ZÑ8Ô8ˆ	ÝÔ˜Y¨Ñ/Ô/Ð/Ð/Ð/r9   rÅ   c                óJ  — |                       ¦   «         }|€t          d¦  «        ‚|                     d¦  «        }t          j                             |d¦  «        }t          j        j        }t          j                             |¦  «                             d¬¦  «        }||k     S )z¡
        Check whether the certificate has expired.

        :return: ``True`` if the certificate has expired, ``False`` otherwise.
        :rtype: bool
        NzUnable to determine notAfterr  z%Y%m%d%H%M%SZ)Útzinfo)	Úget_notAfterr_   rð   ÚdatetimeÚstrptimeÚtimezoneÚutcÚnowÚreplace)r{   Ú
time_bytesÚtime_stringÚ	not_afterÚUTCÚutcnows         r:   Úhas_expiredzX509.has_expired3  s’   € ð ×&Ò&Ñ(Ô(ˆ
ØÐÝÐ;Ñ<Ô<Ð<Ø ×'Ò'¨Ñ0Ô0ˆÝÔ%×.Ò.¨{¸OÑLÔLˆ	åÔÔ#ˆÝÔ"×&Ò& sÑ+Ô+×3Ò3¸4Ð3Ñ@Ô@ˆØ˜6Ò!Ð!r9   Úwhichr<   c                ó<   — t           || j        ¦  «        ¦  «        S rC   )ru   rL  )r{   r·  s     r:   Ú_get_boundary_timezX509._get_boundary_timeD  s   € Ý˜e˜e D¤JÑ/Ô/Ñ0Ô0Ð0r9   c                ó@   — |                       t          j        ¦  «        S )a
  
        Get the timestamp at which the certificate starts being valid.

        The timestamp is formatted as an ASN.1 TIME::

            YYYYMMDDhhmmssZ

        :return: A timestamp string, or ``None`` if there is none.
        :rtype: bytes or NoneType
        )r¹  rD   r¥  rz   s    r:   Úget_notBeforezX509.get_notBeforeG  s   € ð ×&Ò&¥tÔ'?Ñ@Ô@Ð@r9   úCallable[..., Any]rY   c                ó>   — t           || j        ¦  «        |¦  «        S rC   )ra   rL  )r{   r·  rY   s      r:   Ú_set_boundary_timezX509._set_boundary_timeT  s    € õ ˜e˜e D¤JÑ/Ô/°Ñ6Ô6Ð6r9   z[X509.set_notBefore is deprecated. You should use cryptography's CertificateBuilder instead.c                óB   — |                       t          j        |¦  «        S )zî
        Set the timestamp at which the certificate starts being valid.

        The timestamp is formatted as an ASN.1 TIME::

            YYYYMMDDhhmmssZ

        :param bytes when: A timestamp string.
        :return: ``None``
        )r¾  rD   r¥  ©r{   rY   s     r:   Úset_notBeforezX509.set_notBeforeY  s   € ð ×&Ò&¥tÔ'?ÀÑFÔFÐFr9   c                ó@   — |                       t          j        ¦  «        S )a	  
        Get the timestamp at which the certificate stops being valid.

        The timestamp is formatted as an ASN.1 TIME::

            YYYYMMDDhhmmssZ

        :return: A timestamp string, or ``None`` if there is none.
        :rtype: bytes or NoneType
        )r¹  rD   r   rz   s    r:   rª  zX509.get_notAfterj  s   € ð ×&Ò&¥tÔ'>Ñ?Ô?Ð?r9   zZX509.set_notAfter is deprecated. You should use cryptography's CertificateBuilder instead.c                óB   — |                       t          j        |¦  «        S )zí
        Set the timestamp at which the certificate stops being valid.

        The timestamp is formatted as an ASN.1 TIME::

            YYYYMMDDhhmmssZ

        :param bytes when: A timestamp string.
        :return: ``None``
        )r¾  rD   r   rÀ  s     r:   Úset_notAfterzX509.set_notAfterw  s   € ð ×&Ò&¥tÔ'>ÀÑEÔEÐEr9   r#   c                óÀ   — t                                t          ¦  «        } || j        ¦  «        |_        t          |j        t          j        k    ¦  «         | |_        |S rC   )	ÚobjectrP  r#   rL  rƒ   rM   rI   rN   Ú_owner)r{   r·  r}   s      r:   Ú	_get_namezX509._get_nameˆ  sM   € õ �~Š~�hÑ'Ô'ˆØ�U˜4œ:Ñ&Ô&ˆŒ
Ý˜œ
¥d¤iÒ/Ñ0Ô0Ð0ð ˆŒàˆr9   r}   c                ó    — t          |t          ¦  «        st          d¦  «        ‚ || j        |j        ¦  «        }t          |dk    ¦  «         d S )Nzname must be an X509Namer´   )r\   r#   r]   rL  rƒ   rM   )r{   r·  r}   r`   s       r:   Ú	_set_namezX509._set_name•  sP   € Ý˜$¥Ñ)Ô)ð 	8ÝÐ6Ñ7Ô7Ð7Ø�U˜4œ: t¤zÑ2Ô2ˆ
Ý˜
 ašÑ(Ô(Ð(Ð(Ð(r9   zPX509.get_issuer is deprecated. You should use cryptography's X.509 APIs instead.c                óx   — |                       t          j        ¦  «        }| j                             |¦  «         |S )a¥  
        Return the issuer of this certificate.

        This creates a new :class:`X509Name` that wraps the underlying issuer
        name field on the certificate. Modifying it will modify the underlying
        certificate, and will have the effect of modifying any other
        :class:`X509Name` that refers to this issuer.

        :return: The issuer of this certificate.
        :rtype: :class:`X509Name`
        )rÈ  rD   ÚX509_get_issuer_namerM  r�   r€   s     r:   Ú
get_issuerzX509.get_issuer›  s4   € ð  �~Š~�dÔ7Ñ8Ô8ˆØÔ ×$Ò$ TÑ*Ô*Ð*Øˆr9   zXX509.set_issuer is deprecated. You should use cryptography's CertificateBuilder instead.Úissuerc                óx   — |                       t          j        |¦  «         | j                             ¦   «          dS )zŸ
        Set the issuer of this certificate.

        :param issuer: The issuer.
        :type issuer: :py:class:`X509Name`

        :return: ``None``
        N)rÊ  rD   ÚX509_set_issuer_namerM  r„   )r{   rÎ  s     r:   Ú
set_issuerzX509.set_issuer¯  s6   € ð 	�Š•tÔ0°&Ñ9Ô9Ð9ØÔ ×&Ò&Ñ(Ô(Ð(Ð(Ð(r9   zQX509.get_subject is deprecated. You should use cryptography's X.509 APIs instead.c                óx   — |                       t          j        ¦  «        }| j                             |¦  «         |S )a©  
        Return the subject of this certificate.

        This creates a new :class:`X509Name` that wraps the underlying subject
        name field on the certificate. Modifying it will modify the underlying
        certificate, and will have the effect of modifying any other
        :class:`X509Name` that refers to this subject.

        :return: The subject of this certificate.
        :rtype: :class:`X509Name`
        )rÈ  rD   ÚX509_get_subject_namerN  r�   r€   s     r:   Úget_subjectzX509.get_subject¿  s4   € ð  �~Š~�dÔ8Ñ9Ô9ˆØÔ!×%Ò% dÑ+Ô+Ð+Øˆr9   zYX509.set_subject is deprecated. You should use cryptography's CertificateBuilder instead.Úsubjectc                óx   — |                       t          j        |¦  «         | j                             ¦   «          dS )z£
        Set the subject of this certificate.

        :param subject: The subject.
        :type subject: :py:class:`X509Name`

        :return: ``None``
        N)rÊ  rD   ÚX509_set_subject_namerN  r„   )r{   rÕ  s     r:   Úset_subjectzX509.set_subjectÓ  s6   € ð 	�Š•tÔ1°7Ñ;Ô;Ð;ØÔ!×'Ò'Ñ)Ô)Ð)Ð)Ð)r9   c                ó4   — t          j        | j        ¦  «        S )z¯
        Get the number of extensions on this certificate.

        :return: The number of extensions.
        :rtype: :py:class:`int`

        .. versionadded:: 0.12
        )rD   ÚX509_get_ext_countrL  rz   s    r:   Úget_extension_countzX509.get_extension_countã  s   € õ Ô& t¤zÑ2Ô2Ð2r9   Nr…   )r   r   r=   r    )r=   rS  )rX  rS  r=   r    )r]  r0   r=   rZ   rÓ   )r=   r"   )rŽ   r"   r=   rZ   )rŽ   r"   rk  rñ   r=   rZ   rG  )rz  rñ   r=   rR   )r‰  r0   r=   rZ   )r�  r0   r=   rZ   rÒ   )r·  r   r=   r<   )r=   r<   )r·  r¼  rY   rR   r=   rZ   )rY   rR   r=   rZ   )r·  r   r=   r#   )r·  r   r}   r#   r=   rZ   )r=   r#   )rÎ  r#   r=   rZ   )rÕ  r#   r=   rZ   )$r4   r5   r6   r7   r|   rÔ   rR  rW  r\  r   r`  rc  rf  rj  rr  ry  rk  rˆ  r•  rœ  r£  r§  r¶  r¹  r»  r¾  rÁ  rª  rÄ  rÈ  rÊ  rÍ  rÑ  rÔ  rØ  rÛ  r8   r9   r:   r    r      s"  € € € € € ðð ð;ð ;ð ;ð ;ð ðð ð ñ „[ðð.ð .ð .ð .ð ð4ð 4ð 4ñ „[ð4ð& €Zð	5ñô ðIð Ið Iñ	ô ðIð1ð 1ð 1ð 1ðð ð ð ð €Zð	5ñô ð)ð )ð )ñ	ô ð)ð €Zð	5ñô ð)ð )ð )ñ	ô ð)ð81ð 1ð 1ð 1ð&
ð 
ð 
ð 
ð>7ð 7ð 7ð 7ð €Zð	5ñô ð)ð )ð )ñ	ô ð)ð8(ð (ð (ð (ð( €Zð	5ñô ð/ð /ð /ñ	ô ð/ð €Zð	5ñô ð0ð 0ð 0ñ	ô ð0ð"ð "ð "ð "ð"1ð 1ð 1ð 1ðAð Að Að Að7ð 7ð 7ð 7ð
 €Zð	5ñô ðGð Gð Gñ	ô ðGð@ð @ð @ð @ð €Zð	5ñô ðFð Fð Fñ	ô ðFðð ð ð ð)ð )ð )ð )ð €Zð	-ñô ðð ð ñ	ô ðð  €Zð	5ñô ð
)ð 
)ð 
)ñ	ô ð
)ð €Zð	-ñô ðð ð ñ	ô ðð  €Zð	5ñô ð
*ð 
*ð 
*ñ	ô ð
*ð	3ð 	3ð 	3ð 	3ð 	3ð 	3r9   r    c                  ó  — e Zd ZU dZej        Zded<   ej        Z	ded<   ej
        Zded<   ej        Zded<   ej        Zded<   ej        Zded<   ej        Zded	<   ej        Zded
<   ej        Zded<   ej        Zded<   dS )r'   a  
    Flags for X509 verification, used to change the behavior of
    :class:`X509Store`.

    See `OpenSSL Verification Flags`_ for details.

    .. _OpenSSL Verification Flags:
        https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_flags.html
    r0   Ú	CRL_CHECKÚCRL_CHECK_ALLÚIGNORE_CRITICALÚX509_STRICTÚALLOW_PROXY_CERTSÚPOLICY_CHECKÚEXPLICIT_POLICYÚINHIBIT_MAPÚCHECK_SS_SIGNATUREÚPARTIAL_CHAINN)r4   r5   r6   r7   rD   ÚX509_V_FLAG_CRL_CHECKrÝ  Ú__annotations__ÚX509_V_FLAG_CRL_CHECK_ALLrÞ  ÚX509_V_FLAG_IGNORE_CRITICALrß  ÚX509_V_FLAG_X509_STRICTrà  ÚX509_V_FLAG_ALLOW_PROXY_CERTSrá  ÚX509_V_FLAG_POLICY_CHECKrâ  ÚX509_V_FLAG_EXPLICIT_POLICYrã  ÚX509_V_FLAG_INHIBIT_MAPrä  ÚX509_V_FLAG_CHECK_SS_SIGNATURErå  ÚX509_V_FLAG_PARTIAL_CHAINræ  r8   r9   r:   r'   r'   ï  sè   € € € € € € ðð ð Ô/€IÐ/Ð/Ð/Ñ/ØÔ7€MÐ7Ð7Ð7Ñ7ØÔ;€OÐ;Ð;Ð;Ñ;ØÔ3€KÐ3Ð3Ð3Ñ3Ø!Ô?ÐÐ?Ð?Ð?Ñ?ØÔ5€LÐ5Ð5Ð5Ñ5ØÔ;€OÐ;Ð;Ð;Ñ;ØÔ3€KÐ3Ð3Ð3Ñ3Ø"ÔAÐÐAÐAÐAÑAØÔ7€MÐ7Ð7Ð7Ñ7Ð7Ð7r9   r'   c                  óF   — e Zd ZdZdd„Zdd„Zdd
„Zdd„Zdd„Z	 ddd„Z	dS )r$   aº  
    An X.509 store.

    An X.509 store is used to describe a context in which to verify a
    certificate. A description of a context may include a set of certificates
    to trust, a set of certificate revocation lists, verification flags and
    more.

    An X.509 store, being only a description, cannot be used by itself to
    verify a certificate. To carry out the actual verification process, see
    :class:`X509StoreContext`.
    r=   rZ   c                ót   — t          j        ¦   «         }t          j        |t           j        ¦  «        | _        d S rC   )rD   ÚX509_STORE_newrI   rO   ÚX509_STORE_freeÚ_store©r{   Ústores     r:   r|   zX509Store.__init__  s*   € ÝÔ#Ñ%Ô%ˆÝ”g˜e¥TÔ%9Ñ:Ô:ˆŒˆˆr9   rQ  r    c                ó°   — t          |t          ¦  «        st          ¦   «         ‚t          j        | j        |j        ¦  «        }t          |dk    ¦  «         dS )aÔ  
        Adds a trusted certificate to this store.

        Adding a certificate with this method adds this certificate as a
        *trusted* certificate.

        :param X509 cert: The certificate to add to this store.

        :raises TypeError: If the certificate is not an :class:`X509`.

        :raises OpenSSL.crypto.Error: If OpenSSL was unhappy with your
            certificate.

        :return: ``None`` if the certificate was added successfully.
        r´   N)r\   r    r]   rD   ÚX509_STORE_add_certrö  rL  rM   )r{   rQ  rÃ   s      r:   Úadd_certzX509Store.add_cert  sN   € õ  ˜$¥Ñ%Ô%ð 	Ý‘+”+ÐåÔ& t¤{°D´JÑ?Ô?ˆÝ˜˜qšÑ!Ô!Ð!Ð!Ð!r9   Úcrlúx509.CertificateRevocationListc                óÀ  — t          |t          j        ¦  «        r‰ddlm} t          |                     |j        ¦  «        ¦  «        }t          j	        |t          j        ¦  «        }t          |t          j        k    ¦  «         t          j        |t          j        ¦  «        }nt          d¦  «        ‚t          t          j        | j        |¦  «        dk    ¦  «         dS )aþ  
        Add a certificate revocation list to this store.

        The certificate revocation lists added to a store will only be used if
        the associated flags are configured to check certificate revocation
        lists.

        .. versionadded:: 16.1.0

        :param crl: The certificate revocation list to add to this store.
        :type crl: ``cryptography.x509.CertificateRevocationList``
        :return: ``None`` if the certificate revocation list was added
            successfully.
        r   rZ  z?CRL must be of type cryptography.x509.CertificateRevocationListN)r\   r   ÚCertificateRevocationListr”   rœ   rQ   rª   r«   rD   Úd2i_X509_CRL_biorI   rN   rM   rO   ÚX509_CRL_freer]   ÚX509_STORE_add_crlrö  )r{   rü  rœ   r@   Úopenssl_crls        r:   Úadd_crlzX509Store.add_crl.  sÈ   € õ �c�4Ô9Ñ:Ô:ð 	ØMÐMÐMÐMÐMÐMå˜s×/Ò/°´Ñ=Ô=Ñ>Ô>ˆCÝÔ/°µT´YÑ?Ô?ˆKÝ˜K­4¬9Ò4Ñ5Ô5Ð5Ý”'˜+¥tÔ'9Ñ:Ô:ˆCˆCåð>ñô ð õ
 	�Ô/°´¸SÑAÔAÀQÒFÑGÔGÐGÐGÐGr9   Úflagsr0   c                ó\   — t          t          j        | j        |¦  «        dk    ¦  «         dS )aÒ  
        Set verification flags to this store.

        Verification flags can be combined by oring them together.

        .. note::

          Setting a verification flag sometimes requires clients to add
          additional information to the store, otherwise a suitable error will
          be raised.

          For example, in setting flags to enable CRL checking a
          suitable CRL must be added to the store otherwise an error will be
          raised.

        .. versionadded:: 16.1.0

        :param int flags: The verification flags to set on this store.
            See :class:`X509StoreFlags` for available constants.
        :return: ``None`` if the verification flags were successfully set.
        r   N)rM   rD   ÚX509_STORE_set_flagsrö  )r{   r  s     r:   Ú	set_flagszX509Store.set_flagsL  s,   € õ, 	�Ô1°$´+¸uÑEÔEÈÒJÑKÔKÐKÐKÐKr9   Úvfy_timeúdatetime.datetimec                ó2  — t          j        ¦   «         }t          j        |t           j        ¦  «        }t          j        |t          j        |                     ¦   «         ¦  «        ¦  «         t          t          j
        | j        |¦  «        dk    ¦  «         dS )a¤  
        Set the time against which the certificates are verified.

        Normally the current time is used.

        .. note::

          For example, you can determine if a certificate was valid at a given
          time.

        .. versionadded:: 17.0.0

        :param datetime vfy_time: The verification time to set on this store.
        :return: ``None`` if the verification time was successfully set.
        r   N)rD   ÚX509_VERIFY_PARAM_newrI   rO   ÚX509_VERIFY_PARAM_freeÚX509_VERIFY_PARAM_set_timeÚcalendarÚtimegmÚ	timetuplerM   ÚX509_STORE_set1_paramrö  )r{   r	  Úparams      r:   Úset_timezX509Store.set_timed  s€   € õ  Ô*Ñ,Ô,ˆÝ”˜�tÔ:Ñ;Ô;ˆåÔ'Ø•8”? 8×#5Ò#5Ñ#7Ô#7Ñ8Ô8ñ	
ô 	
ð 	
õ 	�Ô2°4´;ÀÑFÔFÈ!ÒKÑLÔLÐLÐLÐLr9   NÚcafileúStrOrBytesPath | NoneÚcapathc                óØ   — |€t           j        }nt          |¦  «        }|€t           j        }nt          |¦  «        }t          j        | j        ||¦  «        }|st          ¦   «          dS dS )aˆ  
        Let X509Store know where we can find trusted certificates for the
        certificate chain.  Note that the certificates have to be in PEM
        format.

        If *capath* is passed, it must be a directory prepared using the
        ``c_rehash`` tool included with OpenSSL.  Either, but not both, of
        *cafile* or *capath* may be ``None``.

        .. note::

          Both *cafile* and *capath* may be set simultaneously.

          Call this method multiple times to add more than one location.
          For example, CA certificates, and certificate revocation list bundles
          may be passed in *cafile* in subsequent calls to this method.

        .. versionadded:: 20.0

        :param cafile: In which file we can find the certificates (``bytes`` or
                       ``unicode``).
        :param capath: In which directory we can find the certificates
                       (``bytes`` or ``unicode``).

        :return: ``None`` if the locations were set successfully.

        :raises OpenSSL.crypto.Error: If both *cafile* and *capath* is ``None``
            or the locations could not be set for any reason.

        N)rI   rN   Ú_path_bytesrD   ÚX509_STORE_load_locationsrö  rÌ   )r{   r  r  Úload_results       r:   Úload_locationszX509Store.load_locations|  s|   € ðF ˆ>Ý”YˆFˆFå  Ñ(Ô(ˆFàˆ>Ý”YˆFˆFå  Ñ(Ô(ˆFåÔ4ØŒK˜ ñ
ô 
ˆð ð 	#Ý Ñ"Ô"Ð"Ð"Ð"ð	#ð 	#r9   r…   )rQ  r    r=   rZ   )rü  rý  r=   rZ   )r  r0   r=   rZ   )r	  r
  r=   rZ   rC   )r  r  r  r  r=   rZ   )
r4   r5   r6   r7   r|   rû  r  r  r  r  r8   r9   r:   r$   r$     s¬   € € € € € ðð ð;ð ;ð ;ð ;ð"ð "ð "ð "ð,Hð Hð Hð Hð<Lð Lð Lð Lð0Mð Mð Mð Mð6 )-ð1#ð 1#ð 1#ð 1#ð 1#ð 1#ð 1#r9   r$   c                  ó$   ‡ — e Zd ZdZdˆ fd
„Zˆ xZS )r&   zù
    An exception raised when an error occurred while verifying a certificate
    using `OpenSSL.X509StoreContext.verify_certificate`.

    :ivar certificate: The certificate which caused verificate failure.
    :type certificate: :class:`X509`
    Úmessagerñ   Úerrorsú	list[Any]Úcertificater    r=   rZ   c                óf   •— t          ¦   «                              |¦  «         || _        || _        d S rC   )rÙ   r|   r  r!  )r{   r  r  r!  rÜ   s       €r:   r|   zX509StoreContextError.__init__¹  s2   ø€ õ 	‰Œ×Ò˜Ñ!Ô!Ð!ØˆŒØ&ˆÔÐÐr9   )r  rñ   r  r   r!  r    r=   rZ   )r4   r5   r6   r7   r|   r   r  s   @r:   r&   r&   °  sG   ø€ € € € € ðð ð'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'r9   r&   c                  ón   — e Zd ZdZ	 ddd„Zedd„¦   «         Zedd„¦   «         Zdd„Zdd„Z	dd„Z
dd„ZdS )r%   a9  
    An X.509 store context.

    An X.509 store context is used to carry out the actual verification process
    of a certificate in a described context. For describing such a context, see
    :class:`X509Store`.

    :param X509Store store: The certificates which will be trusted for the
        purposes of any verifications.
    :param X509 certificate: The certificate to be verified.
    :param chain: List of untrusted certificates that may be used for building
        the certificate chain. May be ``None``.
    :type chain: :class:`list` of :class:`X509`
    Nrø  r$   r!  r    ÚchainúSequence[X509] | Noner=   rZ   c                óV   — || _         || _        |                      |¦  «        | _        d S rC   )rö  Ú_certÚ_build_certificate_stackÚ_chain)r{   rø  r!  r$  s       r:   r|   zX509StoreContext.__init__Ñ  s+   € ð ˆŒØ ˆŒ
Ø×3Ò3°EÑ:Ô:ˆŒˆˆr9   Úcertificatesc                ó
  — dd„}| �t          | ¦  «        dk    rt          j        S t          j        ¦   «         }t          |t          j        k    ¦  «         t          j        ||¦  «        }| D ]•}t          |t          ¦  «        st          d¦  «        ‚t          t          j
        |j        ¦  «        dk    ¦  «         t          j        ||j        ¦  «        dk    r't          j        |j        ¦  «         t          ¦   «          Œ–|S )	NÚsr   r=   rZ   c                óÈ   — t          t          j        | ¦  «        ¦  «        D ]+}t          j        | |¦  «        }t          j        |¦  «         Œ,t          j        | ¦  «         d S rC   )r  rD   Úsk_X509_numÚsk_X509_valuerK  Úsk_X509_free)r,  r   Úxs      r:   Úcleanupz:X509StoreContext._build_certificate_stack.<locals>.cleanupß  sb   € õ �4Ô+¨AÑ.Ô.Ñ/Ô/ð "ð "�ÝÔ& q¨!Ñ,Ô,�Ý”˜qÑ!Ô!Ð!Ð!ÝÔ˜aÑ Ô Ð Ð Ð r9   r   z+One of the elements is not an X509 instance)r,  r   r=   rZ   )rL   rI   rN   rD   Úsk_X509_new_nullrM   rO   r\   r    r]   ÚX509_up_refrL  Úsk_X509_pushrK  rÌ   )r*  r2  ÚstackrQ  s       r:   r(  z)X509StoreContext._build_certificate_stackÛ  sû   € ð	!ð 	!ð 	!ð 	!ð Ð¥3 |Ñ#4Ô#4¸Ò#9Ð#9Ý”9ÐåÔ%Ñ'Ô'ˆÝ˜¥¤Ò*Ñ+Ô+Ð+Ý”˜˜wÑ'Ô'ˆà ð 	'ð 	'ˆDÝ˜d¥DÑ)Ô)ð OÝÐ MÑNÔNÐNå�DÔ,¨T¬ZÑ8Ô8¸1Ò<Ñ=Ô=Ð=ÝÔ  ¨¬
Ñ3Ô3°qÒ8Ð8Ý”˜tœzÑ*Ô*Ð*Ý$Ñ&Ô&Ð&øàˆr9   Ú	store_ctxr   r&   c                ó�  — t          j        t          j        t          j        | ¦  «        ¦  «        ¦  «                             d¦  «        }t          j        | ¦  «        t          j        | ¦  «        |g}t          j        | ¦  «        }t          j        |¦  «        }t           
                    |¦  «        }t          |||¦  «        S )zú
        Convert an OpenSSL native context error failure into a Python
        exception.

        When a call to native OpenSSL X509_verify_cert fails, additional
        information about the failure can be obtained from the store context.
        r  )rI   rm   rD   ÚX509_verify_cert_error_stringÚX509_STORE_CTX_get_errorrð   ÚX509_STORE_CTX_get_error_depthÚX509_STORE_CTX_get_current_certÚX509_dupr    rR  r&   )r7  r  r  rL  r'  Úpycerts         r:   Ú_exception_from_contextz(X509StoreContext._exception_from_contextù  s±   € õ ”+ÝÔ.ÝÔ-¨iÑ8Ô8ñô ñ
ô 
÷ Š&�‰/Œ/ð	 	õ Ô)¨)Ñ4Ô4ÝÔ/°	Ñ:Ô:Øð
ˆõ Ô4°YÑ?Ô?ˆÝ”˜eÑ$Ô$ˆÝ×(Ò(¨Ñ/Ô/ˆÝ$ W¨f°fÑ=Ô=Ð=r9   c                óˆ  — t          j        ¦   «         }t          |t          j        k    ¦  «         t          j        |t           j        ¦  «        }t          j        || j        j        | j	        j
        | j        ¦  «        }t          |dk    ¦  «         t          j        |¦  «        }|dk    r|                      |¦  «        ‚|S )a3  
        Verifies the certificate and runs an X509_STORE_CTX containing the
        results.

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.
        r´   r   )rD   ÚX509_STORE_CTX_newrM   rI   rN   rO   ÚX509_STORE_CTX_freeÚX509_STORE_CTX_initrö  r'  rL  r)  ÚX509_verify_certr?  )r{   r7  re   s      r:   Ú_verify_certificatez$X509StoreContext._verify_certificate  s©   € õ Ô+Ñ-Ô-ˆ	Ý˜	¥T¤YÒ.Ñ/Ô/Ð/Ý”G˜I¥tÔ'?Ñ@Ô@ˆ	åÔ&Ø�t”{Ô)¨4¬:Ô+;¸T¼[ñ
ô 
ˆõ 	˜˜qšÑ!Ô!Ð!åÔ# IÑ.Ô.ˆØ�!Š8ˆ8Ø×.Ò.¨yÑ9Ô9Ð9àÐr9   c                ó   — || _         dS )zÖ
        Set the context's X.509 store.

        .. versionadded:: 0.15

        :param X509Store store: The store description which will be used for
            the purposes of any *future* verifications.
        N)rö  r÷  s     r:   Ú	set_storezX509StoreContext.set_store+  s   € ð ˆŒˆˆr9   c                ó.   — |                       ¦   «          dS )a"  
        Verify a certificate in a context.

        .. versionadded:: 0.15

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.
        N)rE  rz   s    r:   Úverify_certificatez#X509StoreContext.verify_certificate6  s   € ð 	× Ò Ñ"Ô"Ð"Ð"Ð"r9   ú
list[X509]c                óÆ  — |                       ¦   «         }t          j        |¦  «        }t          |t          j        k    ¦  «         g }t          t          j        |¦  «        ¦  «        D ]c}t          j        ||¦  «        }t          |t          j        k    ¦  «         t           
                    |¦  «        }|                     |¦  «         Œdt          j        |¦  «         |S )aR  
        Verify a certificate in a context and return the complete validated
        chain.

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.

        .. versionadded:: 20.0
        )rE  rD   ÚX509_STORE_CTX_get1_chainrM   rI   rN   r  r.  r/  r    rR  r   r0  )r{   r7  Ú
cert_stackrÂ   r   rQ  r>  s          r:   Úget_verified_chainz#X509StoreContext.get_verified_chainB  sÊ   € ð ×,Ò,Ñ.Ô.ˆ	õ Ô3°IÑ>Ô>ˆ
Ý˜
¥d¤iÒ/Ñ0Ô0Ð0àˆÝ•tÔ'¨
Ñ3Ô3Ñ4Ô4ð 	"ð 	"ˆAÝÔ% j°!Ñ4Ô4ˆDÝ˜D¥D¤IÒ-Ñ.Ô.Ð.Ý×,Ò,¨TÑ2Ô2ˆFØ�MŠM˜&Ñ!Ô!Ð!Ð!õ 	Ô˜*Ñ%Ô%Ð%Øˆr9   rC   )rø  r$   r!  r    r$  r%  r=   rZ   )r*  r%  r=   rZ   )r7  r   r=   r&   rÿ   )rø  r$   r=   rZ   r…   )r=   rJ  )r4   r5   r6   r7   r|   Ústaticmethodr(  r?  rE  rG  rI  rN  r8   r9   r:   r%   r%   Á  sÌ   € € € € € ðð ð& (,ð	;ð ;ð ;ð ;ð ;ð ðð ð ñ „\ðð: ð>ð >ð >ñ „\ð>ð2ð ð ð ð0	ð 	ð 	ð 	ð
#ð 
#ð 
#ð 
#ðð ð ð ð ð r9   r%   r±   c                óÚ  — t          |t          ¦  «        r|                     d¦  «        }t          |¦  «        }| t          k    r6t          j        |t          j        t          j        t          j        ¦  «        }n:| t          k    r t          j
        |t          j        ¦  «        }nt          d¦  «        ‚|t          j        k    rt          ¦   «          t                               |¦  «        S )a  
    Load a certificate (X509) from the string *buffer* encoded with the
    type *type*.

    :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)

    :param bytes buffer: The buffer the certificate is stored in

    :return: The X509 object
    rî   ú3type argument must be FILETYPE_PEM or FILETYPE_ASN1)r\   rñ   r  rQ   r   rD   ÚPEM_read_bio_X509rI   rN   r   Úd2i_X509_bior_   rÌ   r    rR  )r±   r;   r@   r   s       r:   r-   r-   _  sº   € õ �&�#ÑÔð (Ø—’˜wÑ'Ô'ˆå
�vÑ
Ô
€Cà�|ÒÐÝÔ% c­4¬9µd´iÅÄÑKÔKˆˆØ	•Ò	Ð	ÝÔ  ¥d¤iÑ0Ô0ˆˆåÐNÑOÔOÐOà�tŒyÒÐÝÑÔÐå×"Ò" 4Ñ(Ô(Ð(r9   rQ  c                óh  — t          ¦   «         }| t          k    rt          j        ||j        ¦  «        }n]| t
          k    rt          j        ||j        ¦  «        }n7| t          k    rt          j        ||j        dd¦  «        }nt          d¦  «        ‚t          |dk    ¦  «         t          |¦  «        S )a  
    Dump the certificate *cert* into a buffer string encoded with the type
    *type*.

    :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1, or
        FILETYPE_TEXT)
    :param cert: The certificate to dump
    :return: The buffer with the dumped certificate in
    r   úCtype argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXTr´   )rQ   r   rD   ÚPEM_write_bio_X509rL  r   Úi2d_X509_bior   ÚX509_print_exr_   rM   rW   )r±   rQ  r@   Úresult_codes       r:   r(   r(   |  s®   € õ ‰.Œ.€Cà�|ÒÐÝÔ-¨c°4´:Ñ>Ô>ˆˆØ	•Ò	Ð	ÝÔ'¨¨T¬ZÑ8Ô8ˆˆØ	•Ò	Ð	ÝÔ(¨¨d¬j¸!¸QÑ?Ô?ˆˆåðñ
ô 
ð 	
õ
 �K 1Ò$Ñ%Ô%Ð%Ý˜#ÑÔÐr9   rŽ   c                ó  — t          ¦   «         }| t          k    rt          j        }n'| t          k    rt          j        }nt          d¦  «        ‚ |||j        ¦  «        }|dk    rt          ¦   «          t          |¦  «        S )zú
    Dump a public key to a buffer.

    :param type: The file type (one of :data:`FILETYPE_PEM` or
        :data:`FILETYPE_ASN1`).
    :param PKey pkey: The public key to dump
    :return: The buffer with the dumped key in it.
    :rtype: bytes
    rQ  r´   )
rQ   r   rD   ÚPEM_write_bio_PUBKEYr   Úi2d_PUBKEY_bior_   r‹   rÌ   rW   )r±   rŽ   r@   Ú	write_biorY  s        r:   r*   r*   ˜  s~   € õ ‰.Œ.€CØ�|ÒÐÝÔ-ˆ	ˆ	Ø	•Ò	Ð	ÝÔ'ˆ	ˆ	åÐNÑOÔOÐOà�)˜C ¤Ñ,Ô,€KØ�aÒÐÝÑÔÐå˜#ÑÔÐr9   Úcipherr%  Ú
passphraseúPassphraseCallableT | Nonec           	     ó¶  — t          ¦   «         }t          |t          ¦  «        st          d¦  «        ‚|�R|€t          d¦  «        ‚t	          j        t          |¦  «        ¦  «        }|t          j        k    rt          d¦  «        ‚nt          j        }t          | |¦  «        }| t          k    rHt	          j        ||j        |t          j        d|j        |j        ¦  «        }|                     ¦   «          nÃ| t"          k    rt	          j        ||j        ¦  «        }n�| t&          k    rƒt	          j        |j        ¦  «        t          j        k    rt          d¦  «        ‚t          j        t	          j        |j        ¦  «        t          j        ¦  «        }t	          j        ||d¦  «        }nt          d¦  «        ‚t5          |dk    ¦  «         t7          |¦  «        S )aù  
    Dump the private key *pkey* into a buffer string encoded with the type
    *type*.  Optionally (if *type* is :const:`FILETYPE_PEM`) encrypting it
    using *cipher* and *passphrase*.

    :param type: The file type (one of :const:`FILETYPE_PEM`,
        :const:`FILETYPE_ASN1`, or :const:`FILETYPE_TEXT`)
    :param PKey pkey: The PKey to dump
    :param cipher: (optional) if encrypted PEM format, the cipher to use
    :param passphrase: (optional) if encrypted PEM format, this can be either
        the passphrase to use, or a callback for providing the passphrase.

    :return: The buffer with the dumped key in
    :rtype: bytes

    .. deprecated:: 26.3.0
       Use the serialization APIs on ``cryptography`` private key types
       instead.
    zpkey must be a PKeyNzDif a value is given for cipher one must also be given for passphrasezInvalid cipher namer   z-Only RSA keys are supported for FILETYPE_TEXTrU  )rQ   r\   r"   r]   rD   ÚEVP_get_cipherbynamer  rI   rN   r_   Ú_PassphraseHelperr   ÚPEM_write_bio_PrivateKeyr‹   ÚcallbackÚcallback_argsÚraise_if_problemr   Úi2d_PrivateKey_bior   rÏ   rÈ   rO   rÉ   rÊ   Ú	RSA_printrM   rW   )	r±   rŽ   r^  r_  r@   Ú
cipher_objÚhelperrY  r   s	            r:   r)   r)   ±  s»  € õ2 ‰.Œ.€Cå�d�DÑ!Ô!ð /ÝÐ-Ñ.Ô.Ð.àÐØÐÝð8ñô ð õ Ô.­|¸FÑ/CÔ/CÑDÔDˆ
Ø�œÒ"Ð"ÝÐ2Ñ3Ô3Ð3ð #õ ”Yˆ
å˜t ZÑ0Ô0€FØ�|ÒÐÝÔ3ØØŒJØÝŒIØØŒOØÔ ñ
ô 
ˆð 	×ÒÑ!Ô!Ð!Ð!Ø	•Ò	Ð	ÝÔ-¨c°4´:Ñ>Ô>ˆˆØ	•Ò	Ð	ÝÔ˜DœJÑ'Ô'­4Ô+<Ò<Ð<ÝÐKÑLÔLÐLåŒg•dÔ,¨T¬ZÑ8Ô8½$¼-ÑHÔHˆÝ”n S¨#¨qÑ1Ô1ˆˆåðñ
ô 
ð 	
õ
 �K 1Ò$Ñ%Ô%Ð%å˜#ÑÔÐr9   zGdump_privatekey is deprecated. You should use the APIs in cryptography.r)   rö   c                  ó`   — e Zd Z	 	 ddd„Zedd„¦   «         Zedd„¦   «         Zefdd„Zdd„Z	dS )rc  Fr±   r0   r_  r`  Ú	more_argsrÅ   Útruncater=   rZ   c                óv   — |t           k    r|�t          d¦  «        ‚|| _        || _        || _        g | _        d S )Nz0only FILETYPE_PEM key format supports encryption)r   r_   Ú_passphraseÚ
_more_argsÚ	_truncateÚ	_problems)r{   r±   r_  rm  rn  s        r:   r|   z_PassphraseHelper.__init__	  sL   € ð •<ÒÐ JÐ$:ÝØBñô ð ð &ˆÔØ#ˆŒØ!ˆŒØ*,ˆŒˆˆr9   r   c                óÖ   — | j         €t          j        S t          | j         t          ¦  «        st          | j         ¦  «        rt          j        d| j        ¦  «        S t          d¦  «        ‚)NÚpem_password_cbú2Last argument must be a byte string or a callable.)	rp  rI   rN   r\   rR   Úcallablere  Ú_read_passphraser]   rz   s    r:   re  z_PassphraseHelper.callback  se   € àÔÐ#Ý”9ÐÝ˜Ô(­%Ñ0Ô0ð 	µH¸TÔ=MÑ4NÔ4Nð 	Ý”=Ð!2°DÔ4IÑJÔJÐJåØDñô ð r9   c                óº   — | j         €t          j        S t          | j         t          ¦  «        st          | j         ¦  «        rt          j        S t          d¦  «        ‚)Nrv  )rp  rI   rN   r\   rR   rw  r]   rz   s    r:   rf  z_PassphraseHelper.callback_args$  sW   € àÔÐ#Ý”9ÐÝ˜Ô(­%Ñ0Ô0ð 	µH¸TÔ=MÑ4NÔ4Nð 	Ý”9ÐåØDñô ð r9   ÚexceptionTypeútype[Exception]c                ó€   — | j         r6	 t          |¦  «         n# |$ r Y nw xY w| j                              d¦  «        ‚d S r1  )rs  Ú_exception_from_error_queueÚpop)r{   rz  s     r:   rg  z"_PassphraseHelper.raise_if_problem/  sd   € ØŒ>ð 	(ðÝ+¨MÑ:Ô:Ð:Ð:øØ ð ð ð Ø�ðøøøð ”.×$Ò$ QÑ'Ô'Ð'ð	(ð 	(s   ‰ ™! !ÚbufÚsizeÚrwflagÚuserdatac                óF  — 	 t          | j        ¦  «        r5| j        r|                      |||¦  «        }n&|                      |¦  «        }n| j        €J ‚| j        }t          |t          ¦  «        st          d¦  «        ‚t          |¦  «        |k    r!| j        r|d |…         }nt          d¦  «        ‚t          t          |¦  «        ¦  «        D ]}|||dz   …         ||<   Œt          |¦  «        S # t          $ r%}| j
                             |¦  «         Y d }~dS d }~ww xY w)NzBytes expectedz+passphrase returned by callback is too longr´   r   )rw  rp  rq  r\   rR   r_   rL   rr  r  Ú	Exceptionrs  r   )r{   r  r€  r�  r‚  rÂ   r   Úes           r:   rx  z"_PassphraseHelper._read_passphrase9  sN  € ð	Ý˜Ô(Ñ)Ô)ð *Ø”?ð 6Ø!×-Ò-¨d°F¸HÑEÔE�F�Fà!×-Ò-¨fÑ5Ô5�F�FàÔ'Ð3Ð3Ð3ØÔ)�Ý˜f¥eÑ,Ô,ð 3Ý Ð!1Ñ2Ô2Ð2Ý�6‰{Œ{˜TÒ!Ð!Ø”>ð Ø# E T Eœ]�F�Få$ØEñô ð õ �3˜v™;œ;Ñ'Ô'ð +ð +�Ø  A¨¡E 	Ô*��A‘�Ý�v‘;”;ÐøÝð 	ð 	ð 	ØŒN×!Ò! !Ñ$Ô$Ð$Ø�1�1�1�1�1øøøøð	øøøs   ‚C.C1 Ã1
D Ã;DÄD N)FF)
r±   r0   r_  r`  rm  rÅ   rn  rÅ   r=   rZ   rÿ   )rz  r{  r=   rZ   )
r  r   r€  r0   r�  r   r‚  r   r=   r0   )
r4   r5   r6   r|   Úpropertyre  rf  r!   rg  rx  r8   r9   r:   rc  rc    s©   € € € € € ð
  Øð-ð -ð -ð -ð -ð  ðð ð ñ „Xðð ðð ð ñ „Xðð AFð (ð (ð (ð (ð (ðð ð ð ð ð r9   rc  ústr | bytesc                ó>  — t          |t          ¦  «        r|                     d¦  «        }t          |¦  «        }| t          k    r6t          j        |t          j        t          j        t          j        ¦  «        }n:| t          k    r t          j
        |t          j        ¦  «        }nt          d¦  «        ‚|t          j        k    rt          ¦   «          t                               t          ¦  «        }t          j        |t
          j        ¦  «        |_        d|_        |S )a<  
    Load a public key from a buffer.

    :param type: The file type (one of :data:`FILETYPE_PEM`,
        :data:`FILETYPE_ASN1`).
    :param buffer: The buffer the key is stored in.
    :type buffer: A Python string object, either unicode or bytestring.
    :return: The PKey object.
    :rtype: :class:`PKey`
    rî   rQ  T)r\   rñ   r  rQ   r   rD   ÚPEM_read_bio_PUBKEYrI   rN   r   Úd2i_PUBKEY_bior_   rÌ   r"   rP  rO   rŠ   r‹   r•   )r±   r;   r@   Úevp_pkeyrŽ   s        r:   r/   r/   V  sá   € õ �&�#ÑÔð (Ø—’˜wÑ'Ô'ˆå
�vÑ
Ô
€Cà�|ÒÐÝÔ+Ø•”�DœI¥t¤yñ
ô 
ˆˆð 
•Ò	Ð	ÝÔ& s­D¬IÑ6Ô6ˆˆåÐNÑOÔOÐOà•4”9ÒÐÝÑÔÐå�<Š<�ÑÔ€DÝ”˜¥4Ô#5Ñ6Ô6€D„JØ€DÔØ€Kr9   c                ód  — t          |t          ¦  «        r|                     d¦  «        }t          |¦  «        }t	          | |¦  «        }| t
          k    r@t          j        |t          j	        |j
        |j        ¦  «        }|                     ¦   «          n:| t          k    r t          j        |t          j	        ¦  «        }nt          d¦  «        ‚|t          j	        k    rt!          ¦   «          t"                               t"          ¦  «        }t          j        |t          j        ¦  «        |_        |S )a³  
    Load a private key (PKey) from the string *buffer* encoded with the type
    *type*.

    :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
    :param buffer: The buffer the key is stored in
    :param passphrase: (optional) if encrypted PEM format, this can be
                       either the passphrase to use, or a callback for
                       providing the passphrase.

    :return: The PKey object
    rî   rQ  )r\   rñ   r  rQ   rc  r   rD   ÚPEM_read_bio_PrivateKeyrI   rN   re  rf  rg  r   Úd2i_PrivateKey_bior_   rÌ   r"   rP  rO   rŠ   r‹   )r±   r;   r_  r@   rk  r‹  rŽ   s          r:   r.   r.   x  sü   € õ" �&�#ÑÔð (Ø—’˜wÑ'Ô'ˆå
�vÑ
Ô
€Cå˜t ZÑ0Ô0€FØ�|ÒÐÝÔ/Ø•”˜FœO¨VÔ-Añ
ô 
ˆð 	×ÒÑ!Ô!Ð!Ð!Ø	•Ò	Ð	ÝÔ*¨3µ´	Ñ:Ô:ˆˆåÐNÑOÔOÐOà•4”9ÒÐÝÑÔÐå�<Š<�ÑÔ€DÝ”˜¥4Ô#5Ñ6Ô6€D„JØ€Kr9   rC   )r;   r<   r=   r   )r@   r   r=   rR   )rX   r   rY   rR   r=   rZ   )rY   rR   r=   r   )rg   r   r=   r<   )r=   rÝ   )r}   rñ   r=   rÖ   )r±   r0   r;   rR   r=   r    )r±   r0   rQ  r    r=   rR   )r±   r0   rŽ   r"   r=   rR   )NN)
r±   r0   rŽ   r"   r^  r%  r_  r`  r=   rR   )r±   r0   r;   r‡  r=   r"   )r±   r0   r;   r‡  r_  r`  r=   r"   )gÚ
__future__r   r  r«  Ú	functoolsÚsysr–   Úbase64r   Úcollections.abcr   r   r   r   r	   Úversion_infoÚwarningsr   Útyping_extensionsÚcryptographyr   r   Ú)cryptography.hazmat.primitives.asymmetricr   r   r   r   r   ÚOpenSSL._utilr   r   r  r   r}  r   rI   r   rD   r   Ú_make_assertr   r  Ú__all__r    r¢   r¤   r¦   r¨   Ú_PrivateKeyr¡   r£   r¥   r§   r©   Ú
_PublicKeyr�   rR   ÚPassphraseCallableTÚSSL_FILETYPE_PEMr   rè  ÚSSL_FILETYPE_ASN1r   r   rÈ   r   ÚEVP_PKEY_DSAr   ÚEVP_PKEY_DHr1   ÚEVP_PKEY_ECr2   r„  r!   rÌ   rM   rQ   rW   ra   rf   ru   rw   r"   rÖ   r,   r+   Útotal_orderingr#   r    r'   r$   r&   r%   r-   r(   r*   r)   r—   r4   ÚDeprecationWarningrc  r/   r.   r8   r9   r:   ú<module>r¦     s   ðØ "Ð "Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø Ð Ð Ð Ø 
€
€
€
Ø €€€Ø Ð Ð Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð Ô�wÒÐØ#Ð#Ð#Ð#Ð#Ð#Ð#à,Ð,Ð,Ð,Ð,Ð,à $Ð $Ð $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð ð ð ð ð ð ð )Ð (Ð (Ð (Ð (Ð (ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð €ð2 ØÔØÔØÔØ	ÔØÔð	ô€ð ØÔØÔØÔØ	ÔØÔð	ô€
ð ˆ[˜*Ð$Ô%€Ø˜E 8¨C°¨JÔ#7Ð7Ô8Ð ð Ô)€Ð )Ð )Ð )Ñ )ØÔ+€Ð +Ð +Ð +Ñ +ð €àÔ!€Ð !Ð !Ð !Ñ !ØÔ!€Ð !Ð !Ð !Ñ !ØÔ€Ð Ð Ð Ñ ØÔ€Ð Ð Ð Ñ ðð ð ð ð ˆIñ ô ð ð �wÐ:¸EÑBÔBÐ Ø�,˜uÑ%Ô%€ðð ð ð ð ð4;ð ;ð ;ð ;ð+ð +ð +ð +ð2ð ð ð ð&ð ð ð ð:
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ðF.ð F.ð F.ð F.ð F.ñ F.ô F.ð F.ðRd.ð d.ð d.ð d.ð d.ñ d.ô d.ð d.ðN €ðñô ð5ð 5ð 5ñ	ô ð5ð €ðñô ð1ð 1ð 1ñ	ô ð1ð$ €ðñô ð Ôðð ð ð ð ñ ô ñ Ôñ	ô ð
ðD_3ð _3ð _3ð _3ð _3ñ _3ô _3ð _3ðD8ð 8ð 8ð 8ð 8ñ 8ô 8ð 8ð.g#ð g#ð g#ð g#ð g#ñ g#ô g#ð g#ðT'ð 'ð 'ð 'ð '˜Iñ 'ô 'ð 'ð"[ð [ð [ð [ð [ñ [ô [ð [ð|)ð )ð )ð )ð:ð ð ð ð8ð ð ð ð8 Ø-1ð	Fð Fð Fð Fð FðR ,Ð à €Ô ØØð	ð Ø	ð	ñ 	ô 	ð 	ðKð Kð Kð Kð Kñ Kô Kð Kð\ð ð ð ðJ .2ð&ð &ð &ð &ð &ð &ð &r9   