Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/josepy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/josepy/util.pyc
�
�t0^c@sdZyddlmZmZWn'ek
rIddlmZmZnXddlZddlZddlm	Z	de
fd��YZdefd��YZ
d	efd
��YZdefd��YZd
eefd��YZdeefd��YZdS(sJOSE utilities.i����(tHashabletMappingN(trsatabstractclassmethodcBseZdZeZd�ZRS(s�Descriptor for an abstract classmethod.

    It augments the :mod:`abc` framework with an abstract
    classmethod. This is implemented as :class:`abc.abstractclassmethod`
    in the standard Python library starting with version 3.2.

    This implementation is from a StackOverflow answer that was derived from
    the implementation in the Python 3.3 abc library.
    http://stackoverflow.com/questions/11217878/python-2-7-combine-abc-abstractmethod-and-classmethod.

    cCs#t|_tt|�j|�dS(N(tTruet__isabstractmethod__tsuperRt__init__(tselfttarget((s//usr/lib/python2.7/site-packages/josepy/util.pyRs	(t__name__t
__module__t__doc__RRR(((s//usr/lib/python2.7/site-packages/josepy/util.pyRstComparableX509cBsVeZdZd�Zd�Zejjd�Zd�Z	d�Z
d�Zd�ZRS(s�Wrapper for OpenSSL.crypto.X509** objects that supports __eq__.

    :ivar wrapped: Wrapped certificate or certificate request.
    :type wrapped: `OpenSSL.crypto.X509` or `OpenSSL.crypto.X509Req`.

    cCs=t|tjj�s0t|tjj�s0t�||_dS(N(t
isinstancetOpenSSLtcryptotX509tX509ReqtAssertionErrortwrapped(RR((s//usr/lib/python2.7/site-packages/josepy/util.pyR'scCst|j|�S(N(tgetattrR(Rtname((s//usr/lib/python2.7/site-packages/josepy/util.pyt__getattr__,scCsCt|jtjj�r'tjj}ntjj}|||j�S(sLDumps the object into a buffer with the specified encoding.

        :param int filetype: The desired encoding. Should be one of
            `OpenSSL.crypto.FILETYPE_ASN1`,
            `OpenSSL.crypto.FILETYPE_PEM`, or
            `OpenSSL.crypto.FILETYPE_TEXT`.

        :returns: Encoded X509 object.
        :rtype: str

        (RRRRRtdump_certificatetdump_certificate_request(Rtfiletypetfunc((s//usr/lib/python2.7/site-packages/josepy/util.pyt_dump/scCs,t||j�stS|j�|j�kS(N(Rt	__class__tNotImplementedR(Rtother((s//usr/lib/python2.7/site-packages/josepy/util.pyt__eq__AscCst|j|j�f�S(N(thashRR(R((s//usr/lib/python2.7/site-packages/josepy/util.pyt__hash__GscCs||kS(N((RR((s//usr/lib/python2.7/site-packages/josepy/util.pyt__ne__JscCsdj|jj|j�S(Ns<{0}({1!r})>(tformatRR
R(R((s//usr/lib/python2.7/site-packages/josepy/util.pyt__repr__Ms(
R
RRRRRRt
FILETYPE_ASN1RR R"R#R%(((s//usr/lib/python2.7/site-packages/josepy/util.pyR
 s					t
ComparableKeycBsJeZdZeZd�Zd�Zd�Zd�Zd�Z	d�Z
RS(snComparable wrapper for ``cryptography`` keys.

    See https://github.com/pyca/cryptography/issues/2122.

    cCs
||_dS(N(t_wrapped(RR((s//usr/lib/python2.7/site-packages/josepy/util.pyRYscCst|j|�S(N(RR((RR((s//usr/lib/python2.7/site-packages/josepy/util.pyR\scCs�t||j�s+|jj|jjk	r/tSt|jd�rW|j�|j�kSt|jd�r|j�|j�kStSdS(Ntprivate_numberstpublic_numbers(RRR(RthasattrR)R*(RR((s//usr/lib/python2.7/site-packages/josepy/util.pyR _scCs||kS(N((RR((s//usr/lib/python2.7/site-packages/josepy/util.pyR#kscCsdj|jj|j�S(Ns<{0}({1!r})>(R$RR
R((R((s//usr/lib/python2.7/site-packages/josepy/util.pyR%nscCs|j|jj��S(sGet wrapped public key.(RR(t
public_key(R((s//usr/lib/python2.7/site-packages/josepy/util.pyR,qs(R
RRRR"RRR R#R%R,(((s//usr/lib/python2.7/site-packages/josepy/util.pyR'Qs					tComparableRSAKeycBseZdZd�ZRS(s�Wrapper for ``cryptography`` RSA keys.

    Wraps around:

    - :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey`
    - :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey`

    c	Cs�t|jtj�rd|j�}|j}t|j|j|j	|j
|j|j|j
|jf�St|jtj�r�|j�}t|j|j
|jf�SdS(N(RR(RtRSAPrivateKeyWithSerializationR)R*R!Rtptqtdmp1tdmq1tiqmptntetRSAPublicKeyWithSerialization(Rtprivtpub((s//usr/lib/python2.7/site-packages/josepy/util.pyR"�s	(R
RRR"(((s//usr/lib/python2.7/site-packages/josepy/util.pyR-vstImmutableMapcBs\eZdZd	Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�ZRS(
s5Immutable key to value mapping with attribute access.cKs�t|�t|j�krWtdjdj|j�|rHdj|�nd���nx-|jD]"}tj|||j|��qaWdS(NsA__init__() takes exactly the following arguments: {0} ({1} given)s, tnone(tsett	__slots__t	TypeErrorR$tjointobjectt__setattr__tpop(Rtkwargstslot((s//usr/lib/python2.7/site-packages/josepy/util.pyR�s$cKs)t|�}|j|�t|�|�S(sReturn updated map.(tdicttupdatettype(RRBtitems((s//usr/lib/python2.7/site-packages/josepy/util.pyRE�s
cCs5yt||�SWntk
r0t|��nXdS(N(RtAttributeErrortKeyError(Rtkey((s//usr/lib/python2.7/site-packages/josepy/util.pyt__getitem__�s
cCs
t|j�S(N(titerR<(R((s//usr/lib/python2.7/site-packages/josepy/util.pyt__iter__�scCs
t|j�S(N(tlenR<(R((s//usr/lib/python2.7/site-packages/josepy/util.pyt__len__�scs#tt�fd��jD���S(Nc3s|]}t�|�VqdS(N(R(t.0RC(R(s//usr/lib/python2.7/site-packages/josepy/util.pys	<genexpr>�s(R!ttupleR<(R((Rs//usr/lib/python2.7/site-packages/josepy/util.pyR"�scCstd��dS(Nscan't set attribute(RH(RRtvalue((s//usr/lib/python2.7/site-packages/josepy/util.pyR@�scCs2dj|jjdjd�tj|�D���S(Ns{0}({1})s, css'|]\}}dj||�VqdS(s	{0}={1!r}N(R$(RPRJRR((s//usr/lib/python2.7/site-packages/josepy/util.pys	<genexpr>�s(R$RR
R>tsixt	iteritems(R((s//usr/lib/python2.7/site-packages/josepy/util.pyR%�s((R
RRR<RRERKRMROR"R@R%(((s//usr/lib/python2.7/site-packages/josepy/util.pyR9�s								t
frozendictcBseeZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(
sFrozen dictionary.t_itemst_keysc	Os�|r|rt|�}n;t|�dkrNt|dt�rN|d}n	t��tj|d|�tj|dttt	j
|����dS(NiiRVRW(RDRNRRR=R?R@RQtsortedRStiterkeys(RtargsRBRG((s//usr/lib/python2.7/site-packages/josepy/util.pyR�s
%
	cCs|j|S(N(RV(RRJ((s//usr/lib/python2.7/site-packages/josepy/util.pyRK�scCs
t|j�S(N(RLRW(R((s//usr/lib/python2.7/site-packages/josepy/util.pyRM�scCs
t|j�S(N(RNRV(R((s//usr/lib/python2.7/site-packages/josepy/util.pyRO�scst�fd��jD��S(Nc3s|]}|�|fVqdS(N((RPRJ(R(s//usr/lib/python2.7/site-packages/josepy/util.pys	<genexpr>�s(RQRW(R((Rs//usr/lib/python2.7/site-packages/josepy/util.pyt
_sorted_items�scCst|j��S(N(R!R[(R((s//usr/lib/python2.7/site-packages/josepy/util.pyR"�scCs3y|j|SWntk
r.t|��nXdS(N(RVRIRH(RR((s//usr/lib/python2.7/site-packages/josepy/util.pyR�s
cCstd��dS(Nscan't set attribute(RH(RRRR((s//usr/lib/python2.7/site-packages/josepy/util.pyR@�scCs&djdjd�|j�D���S(Nsfrozendict({0})s, css'|]\}}dj||�VqdS(s	{0}={1!r}N(R$(RPRJRR((s//usr/lib/python2.7/site-packages/josepy/util.pys	<genexpr>�s(R$R>R[(R((s//usr/lib/python2.7/site-packages/josepy/util.pyR%�s(s_itemss_keys(
R
RRR<RRKRMROR[R"RR@R%(((s//usr/lib/python2.7/site-packages/josepy/util.pyRU�s								(Rtcollections.abcRRtImportErrortcollectionsRRSt)cryptography.hazmat.primitives.asymmetricRtclassmethodRR?R
R'R-R9RU(((s//usr/lib/python2.7/site-packages/josepy/util.pyt<module>s
1%.

Spamworldpro Mini