Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/Crypto/PublicKey/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyc


T:Nc@s?dZddlZddlZddlTdddYZdS(s$Id$iN(t*tpubkeycBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZRS(cCsdS(N((tself((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt__init__"scCsG|j}x7|jD],}|j|rt||||<qqW|S(sTo keep key objects platform-independent, the key data is
        converted to standard Python long integers before being
        written out.  It will then be reconverted as necessary on
        restoration.(t__dict__tkeydatathas_keytlong(Rtdtkey((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt__getstate__%s
	cCsAx:|jD]/}|j|r
t|||j|<q
q
WdS(sOn unpickling a key object, the key data is converted to the big
number representation being used, whether that is Python long
integers, MPZ objects, or whatever.N(RRtbignumR(RRR	((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt__setstate__/scCsd}t|tjr-t|}d}nt|tjrNt|}n|j||}|ryttt|S|SdS(sencrypt(plaintext:string|long, K:string|long) : tuple
        Encrypt the string or integer plaintext.  K is a random
        parameter required by some algorithms.
        iiN(t
isinstancettypest
StringTypet
bytes_to_longt_encryptttupletmapt
long_to_bytes(Rt	plaintexttKt	wasStringt
ciphertext((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytencrypt6s	cCsd}t|tjs$|f}nt|dtjrXttt|}d}n|j|}|rwt|S|SdS(scdecrypt(ciphertext:tuple|string|long): string
        Decrypt 'ciphertext' using this key.
        iiN(	R
Rt	TupleTypeRRRRt_decryptR(RRRR((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytdecryptDs	
cCsm|jstdnt|tjr<t|}nt|tjr]t|}n|j||S(ssign(M : string|long, K:string|long) : tuple
        Return a tuple containing the signature for the message M.
        K is a random parameter required by some algorithms.
        s(Private key not available in this object(thas_privatet	TypeErrorR
RRRt_sign(RtMR((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytsignQscCs1t|tjr!t|}n|j||S(sverify(M:string|long, signature:tuple) : bool
        Verify that the signature is valid for the message M;
        returns true if the signature checks out.
        (R
RRRt_verify(RR t	signature((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytverify\scCstjdtdS(Ns0validate() method name is obsolete; use verify()(twarningstwarntDeprecationWarning(RR R#((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytvalidatees	cCsxd}t|tjr-t|}d}nt|tjrNt|}n|j||}|rpt|S|SdS(soblind(M : string|long, B : string|long) : string|long
        Blind message M using blinding factor B.
        iiN(R
RRRt_blindR(RR tBRtblindedmessage((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytblindis	
cCsxd}t|tjr-t|}d}nt|tjrNt|}n|j||}|rpt|S|SdS(ssunblind(M : string|long, B : string|long) : string|long
        Unblind message M using blinding factor B.
        iiN(R
RRRt_unblindR(RR R*Rtunblindedmessage((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytunblindus	
cCsdS(scan_sign() : bool
        Return a Boolean value recording whether this algorithm can
        generate signatures.  (This does not imply that this
        particular key object has the private information required to
        to generate a signature.)
        i((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytcan_signscCsdS(scan_encrypt() : bool
        Return a Boolean value recording whether this algorithm can
        encrypt data.  (This does not imply that this
        particular key object has the private information required to
        to decrypt a message.)
        i((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytcan_encryptscCsdS(scan_blind() : bool
        Return a Boolean value recording whether this algorithm can
        blind data.  (This does not imply that this
        particular key object has the private information required to
        to blind a message.)
        i((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt	can_blindscCsdS(s`size() : int
        Return the maximum number of bits that can be handled by this key.
        i((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pytsizescCsdS(swhas_private() : bool
        Return a Boolean denoting whether the object contains
        private components.
        i((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyRscCs|S(sdpublickey(): object
        Return a new key object containing only the public information.
        ((R((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt	publickeyscCs|j|jkS(sF__eq__(other): 0, 1
        Compare us to other for equality.
        (R
(Rtother((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt__eq__scCs|j|S(sH__ne__(other): 0, 1
        Compare us to other for inequality.
        (R6(RR5((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt__ne__s(t__name__t
__module__RR
RRRR!R$R(R,R/R0R1R2R3RR4R6R7(((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyR!s$		
			
															((t__revision__RR%tCrypto.Util.numberR(((s;/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.pyt<module>s