ok

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/M2Crypto/PGP/
Upload File :
Current File : //usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyo

�

�1Mc@s4dZddlZddlZyddlmZWn!ek
rUddlmZnXddlmZmZddl	m
Z
ddlTd.Zd/Z
d0Zdd1d��YZd
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZied!6ed"6ed#6ed$6ed%6ed&6ed'6ed(6ed)6d!e6d"e6d#e6d$e6d%e6d&e6d'e6d(e6d)e6Zd*d2d+��YZd,�Zd-�ZdS(3seM2Crypto PGP2.

This module implements PGP packets per RFC1991 and various source distributions.

Each packet type is represented by a class; packet classes derive from 
the abstract 'packet' class. 

The 'message digest' packet type, mentioned but not documented in RFC1991,
is not implemented.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.i����N(tStringIO(tEVPtRSA(toctx_to_num(t*sststpacketcBs\eZd	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�ZRS(
cCsPddl}|jdt�||_|dk	rCt|�|_n	d|_dS(Ni����sVDeprecated. No maintainer for PGP. If you use this, please inform M2Crypto maintainer.(twarningstwarntDeprecationWarningtctbtNoneRtbody(tselfR
RR((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt__init__%s	cCsdS(Ni((R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytvalidate/scCstd|jf�dS(Ns%s.pack(): abstract method(tNotImplementedErrort	__class__(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytpack2scCs$t|d�rt|j�SdSdS(Nt_version(thasattrtordRR(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytversion5s
cCs.t|d�r&tjd|j�dSdSdS(Nt
_timestamps>Li(RtstructtunpackRR(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt	timestamp;scCs.t|d�r&tjd|j�dSdSdS(Nt	_validitys>Hi(RRRRR(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytvalidityAscCst|d�r|jSdSdS(Nt_pkc(RRR(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytpkcGscCsX|dkrdt|�fS|dkr>dtjd|�fSdtjd|�fSdS(Niiiis>His>L(tchrRR(R
tlenf((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt_llfMs
cCs#t|j}td|d>B|B�S(Niiii�(t_FACTORYRR(R
tllftctbv((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt_ctbVs
N(t__name__t
__module__RRRRRRRRR!R%(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR$s
								tpublic_key_packetcBs&eZdd�Zd�Zd�ZRS(cCstj|||�|jdk	r|jjd�|_|jjd�|_|jjd�|_|jjd�|_|jjd�|_	t
jd|j	�ddd}|jj|�|_|jjd�|_
t
jd|j
�ddd}|jj|�|_ndS(Niiis>Hiii(RRRRtreadRRRRt_nlenRRt_nt_elent_e(R
R
Rtnlentelen((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR\s!!cCs	|jdkr�t�|_|jj|j�|jj|j�|jj|j�|jj|j�|jj|j�|jj|j	�|jj|j
�|jj|j�n|jj�|_|j
t|j��\}}|j|�}d|||jfS(Ns%s%s%s(RRRtwriteRRRRR*R+R,R-tgetvalueR!tlenR%(R
R#R R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRlscCs
|jj�S(N(t_pubkeytpub(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytpubkey|sN(R&R'RRRR5(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR([s	ttrust_packetcBseZdd�ZRS(cCs;tj|||�|dk	r7|jjd�|_ndS(Ni(RRRRR)ttrust(R
R
R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�sN(R&R'RR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR6�st
userid_packetcBs&eZdd�Zd�Zd�ZRS(cCs/tj|||�|dk	r+||_ndS(N(RRRt_userid(R
R
R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�scCsp|jdkrbt�|_|jjtt|j���|jj|j�|jj�|_n|j|jS(N(	RRRR0RR2R9R1R
(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�scCs|jS(N(R9(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytuserid�sN(R&R'RRRR:(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR8�s	tcomment_packetcBseZdd�Zd�ZRS(cCs8tj|||�|dk	r4|jj�|_ndS(N(RRRRR1tcomment(R
R
R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�scCsp|jdkrbt�|_|jjtt|j���|jj|j�|jj�|_n|j|jS(N(	RRRR0RR2R<R1R
(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�sN(R&R'RRR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR;�stsignature_packetcBs&eZdd�Zd�Zd�ZRS(cCs�tj|||�|dk	r�|jjd�|_|jjd�|_|jjd�|_|jjd�|_|jjd�|_	|jjd�|_
|jjd�|_|jjd�|_|jj�|_
ndS(Niiii(RRRRR)Rt
_len_md_stufft_classificationRt_keyidRt_md_algot
_md_chksumt_sig(R
R
R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�scCs|jdkr�t�|_|jj|j�|jj|j�|jj|j�|jj|j�|jj|j�|jj|j	�|jj|j
�|jj|j�|jj|j�|jj
�|_n|jtt��\}}|j|B|_d|j||jfS(Ns%s%s%s(RRRR0RR>R?RR@RRARBRCR1R!R2R
(R
R#R ((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�scCs*|jtkrdS|jdkr&dSdS(Ns(Rt_OK_VERSIONRR>(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�sN(R&R'RRRR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR=�s
	tprivate_key_packetcBseZdd�Zd�ZRS(cCs�tj|||�|dk	r�|jjd�|_|jjd�|_|jjd�|_|jjd�|_|jjd�|_	t
jd|j	�ddd}|jj|�|_|jjd�|_
t
jd|j
�ddd}|jj|�|_|jjd�|_|jdkrE|jjd�|_n	d|_x�d	d
ddgD]n}|jjd�}t|d
|d|�t
jd|�ddd}t|d
||jj|��qaW|jjd�|_ndS(Niiis>Hiiistdtptqtut_R2(RRRRR)RRRRR*RRR+R,R-t_ciphert_ivtsetattrt_cksum(R
R
RR.R/tparamt_plentplen((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�s,!!	$cCs
t|j�S(N(RRK(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytis_encrypted�sN(R&R'RRRR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRE�st
cke_packetcBseZdd�ZRS(cCsbtj|||�|dk	r^|jjd�|_|jjd�|_|jj�|_ndS(Nii(RRRRR)RLRNt_ctxt(R
R
R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�s
N(R&R'RR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRS�st
pke_packetcBseZdd�ZRS(cCs�tj|||�|dk	r�|jjd�|_|jjd�|_t|jjd��|_t	j
d|jjd��ddd}t|jj|��|_ndS(Niis>Hiii(
RRRRR)RR@RRRRRt_dek(R
R
Rtdeklen((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR�s*N(R&R'RR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRU�stliteral_packetcBseZdd�ZRS(cCswtj|||�|dk	rs|jjd�|_|jjd�}|jj|�|_|jjd�|_ndS(Nii(RRRRR)tfmodetfnametftime(R
R
Rtfnlen((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR	sN(R&R'RR(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRXstcompressed_packetcBs#eZd�Zd�Zd�ZRS(cCsGtj||d�tdk	rC|jd�|_|j�|_ndS(Nti(RRRRR)talgotdata(R
R
tstream((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRscCs
|jdkS(Ns(R_(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRscCs7ddl}|jd�}t|j|j��}|S(Ni����i�(tzlibt
decompressobjRt
decompressR`(R
RbtdecompRa((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt
uncompresss(R&R'RRRf(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR]s		iiiii	iii
it
packet_streamcBs/eZd�Zd�Zdd�Zd�ZRS(cCs||_d|_d|_dS(Ni(RaRt
under_currentt_count(R
tinput((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRAs		cCs0|jj�|jdk	r,|jj�ndS(N(RatcloseRhR(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRkFs
ic	Cs�xM|jjd�}|sdSt|�}t|�r;Pq|rGqqt�q|d@d?}|tkr�|j|_t||j�}|j	�|_|j�S|d@}|dkr�t|jjd��}nk|dkrt
jd|jjd��d}n:|dkr4t
jd|jjd��d}n	td	�|jj|�}|sht|�|krttd
�n|jj
�|_yt|||�SWntk
r�t||�SXdS(Nii<iiis>Hs>Lisimpossible casescorrupted packet(RaR)RRtis_ctbtXXXErrortCTB_COMPRESSED_DATARhR]RfRRR2ttellRiR"tKeyErrorR(	R
tkeep_tryingtctb0R
tctbttcpR#R R((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyR)Ks@	

%%	
cCs|jS(N(Ri(R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytcountts(R&R'RRkR)Ru(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRg@s		)cCs|d@S(Ni�((R
((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyRlwscCstd|d>B|B�S(Niiii�(R(tvalueR#((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pytmake_ctbzs(ss(s(s(((t__doc__Rttimet	cStringIORtImportErrortM2CryptoRRt
M2Crypto.utilRt	constantsRDt_OK_VALIDITYt_OK_PKCRR(R6R8R;R=RERSRURXR]R"RgRlRw(((s9/usr/lib64/python2.7/site-packages/M2Crypto/PGP/packet.pyt<module>sX

7%'#	
7	

Zerion Mini Shell 1.0