KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21585/root/usr/lib64/python2.4/site-packages/M2Crypto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21585/root/usr/lib64/python2.4/site-packages/M2Crypto/RSA.pyc
mò
:PDc@sdZdkZdkZdkZdkZdkZdefd„ƒYZeieƒei	Z	ei
Z
eiZeiZdfd„ƒYZ
de
fd„ƒYZd„Zeid	„Zed
„Zeid„Zeid„Zeid
„Zd„Zd„Zd„ZdS(scM2Crypto wrapper for OpenSSL RSA API.

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.NtRSAErrorcBstZRS(N(t__name__t
__module__(((t2/usr/lib64/python2.4/site-packages/M2Crypto/RSA.pyRstRSAcBsìtZdZeiZdd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zdeid„Zdeid
„ZeZdeid„Zd„Zd„Zd„Zd„Zd„Zdd„Zdd„ZRS(s
    RSA Key Pair.
    icCs0ti|ƒp
td‚||_||_dS(Ns'rsa' type error(tm2trsa_type_checktrsatAssertionErrortselft_pyfree(R	RR
((Rt__init__s	cCs+t|ddƒo|i|iƒndS(NR
i(tgetattrR	tm2_rsa_freeR(R	((Rt__del__scCsti|iƒd>S(Ni(Rtrsa_sizeR	R(R	((Rt__len__"scCsL|djoti|iƒSn(|djoti|iƒSnt‚dS(Ntetn(tnameRt	rsa_get_eR	Rt	rsa_get_ntAttributeError(R	R((Rt__getattr__%s


cCs9|iƒp
td‚ti|iƒti|iƒfS(Nskey is not initialised(R	t	check_keyRRRRR(R	((Rtpub-scCs-|iƒp
td‚ti|i||ƒS(Nskey is not initialised(R	RRRtrsa_public_encryptRtdatatpadding(R	RR((Rtpublic_encrypt1scCs-|iƒp
td‚ti|i||ƒS(Nskey is not initialised(R	RRRtrsa_public_decryptRRR(R	RR((Rtpublic_decrypt5scCs-|iƒp
td‚ti|i||ƒS(Nskey is not initialised(R	RRRtrsa_private_encryptRRR(R	RR((Rtprivate_encrypt9scCs-|iƒp
td‚ti|i||ƒS(Nskey is not initialised(R	RRRtrsa_private_decryptRRR(R	RR((Rtprivate_decrypt=staes_128_cbccCs‰|djo ti|i|iƒ|ƒSnYt	t|dƒ}|djotd|‚n
|ƒ}ti|i|iƒ||ƒSdS(sR
        Save the key pair to an M2Crypto.BIO.BIO object in PEM format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.

        @type cipher: string
        @param cipher: Symmetric cipher to protect the key. The default
        cipher is 'aes_128_cbc'. If cipher is None, then the key is saved
        in the clear.

        @type callback: Python callable
        @param callback: A Python callable object that is invoked
        to acquire a passphrase with which to protect the key.
        The default is util.passphrase_callback.
        snot such cipher %sN(
tciphertNoneRtrsa_write_key_no_cipherR	Rtbiot_ptrtcallbackRtciphRt
rsa_write_key(R	R(R%R*R+((Rtsave_key_bioAs
 
	cCs%ti|dƒ}|i|||ƒS(s+
        Save the key pair to a file in PEM format.

        @type file: string
        @param file: Name of file to save key to.

        @type cipher: string
        @param cipher: Symmetric cipher to protect the key. The default
        cipher is 'aes_128_cbc'. If cipher is None, then the key is saved
        in the clear.

        @type callback: Python callable
        @param callback: A Python callable object that is invoked
        to acquire a passphrase with which to protect the key.
        The default is util.passphrase_callback.
        twbN(tBIOtopenfiletfileR(R	R-R%R*(R	R1R%R*R(((Rtsave_key\scCs)tiƒ}|i|||ƒ|iƒS(sB
        Returns the key(pair) as a string in PEM format.
        N(R/tMemoryBufferR(R	R-R%R*tread(R	R%R*R(((Rtas_pemrscCsti|i|iƒƒS(s±
        Save the key pair to an M2Crypto.BIO.BIO object in DER format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.
        N(Rtrsa_write_key_derR	RR(R)(R	R(((Rtsave_key_der_biozscCsti|dƒ}|i|ƒS(s
        Save the key pair to a file in DER format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.
        R.N(R/R0R1R(R	R7(R	R1R(((Rtsave_key_derƒscCsti|i|iƒƒS(s³
        Save the public key to an M2Crypto.BIO.BIO object in PEM format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.
        N(Rtrsa_write_pub_keyR	RR(R)(R	R(((Rtsave_pub_key_bioscCs+ti|dƒ}ti|i|iƒƒS(sŒ
        Save the public key to a file in PEM format.

        @type file: string
        @param file: Name of file to save key to.
        R.N(	R/R0R1R(RR9R	RR)(R	R1R(((Rtsave_pub_key–scCsti|iƒS(N(Rt
rsa_check_keyR	R(R	((RR stsha1cCsLttd|dƒ}|djotd|f‚nti|i||ƒS(ss
        Signs a digest with the private key

        @type digest: str
        @param digest: A digest created by using the digest method

        @type algo: str
        @param algo: The method that created the digest.
        Legal values are 'sha1','sha224', 'sha256', 'ripemd160', 
        and 'md5'.
        
        @return a string which is the signature
        tNID_sunknown algorithmN(
RRtalgoR&tdigest_typet
ValueErrortrsa_signR	Rtdigest(R	RCR?R@((Rtsign£s


cCsOttd|dƒ}|djotd|f‚nti|i|||ƒS(s

        Verifies the signature with the public key

        @type data: str
        @param data: Data that has been signed

        @type signature: str
        @param signature: The signature signed with the private key

        @type algo: str
        @param algo: The method use to create digest from the data 
        before it was signed.  Legal values are 'sha1','sha224',
        'sha256', 'ripemd160', and 'md5'.

        @returns True or False, depending on whether the signature was
        verified.  
        R>sunknown algorithmN(RRR?R&R@RAt
rsa_verifyR	RRt	signature(R	RRFR?R@((Rtverify·s

(RRt__doc__Rtrsa_freeR
RRRRRRRR!R#tutiltpassphrase_callbackR-R2tsave_pemR5R7R8R:R;RRDRG(((RRs,												
			
	tRSA_pubcBsDtZdZd„Zd„Zd„ZeiZei	Z
d„ZRS(s0
    Object interface to an RSA public key.
    cCs1|ddgjo
td‚n||i|<dS(NRRs0use factory function new_pub_key() to set (e, n)(RRtvalueR	t__dict__(R	RRN((Rt__setattr__Ös
cGs
td‚dS(Ns!RSA_pub object has no private key(R(R	targv((RR!ÝscGs
td‚dS(Ns!RSA_pub object has no private key(R(R	RQ((RR#àscCsti|iƒS(N(Rtrsa_check_pub_keyR	R(R	((RRës(RRRHRPR!R#RR;R2R:R-R(((RRMÐs					cCsttitiƒƒ‚dS(N(RRterr_reason_error_stringt
err_get_error(((Rt	rsa_errorïscCs1ddddg}|i||ƒ|iƒdS(s)
    Default callback for gen_key().
    t.t+t*s
N(tchtouttwritetptflush(R\RRZRY((Rtkeygen_callbackóscCstti|||ƒdƒS(s·
    Generate an RSA key pair.

    @type bits: int
    @param bits: Key length, in bits.

    @type e: int
    @param e: The RSA public exponent.

    @type callback: Python callable
    @param callback: A Python callable object that is invoked
    during key generation; its usual purpose is to provide visual
    feedback. The default callback is keygen_callback.

    @rtype: M2Crypto.RSA.RSA
    @return: M2Crypto.RSA.RSA object.
    iN(RRtrsa_generate_keytbitsRR*(R`RR*((Rtgen_keyüscCsti|ƒ}t||ƒS(s–
    Load an RSA key pair from file.

    @type file: string
    @param file: Name of file containing RSA public key in PEM format.

    @type callback: Python callable
    @param callback: A Python callable object that is invoked
    to acquire a passphrase with which to unlock the key.
    The default is util.passphrase_callback.

    @rtype: M2Crypto.RSA.RSA
    @return: M2Crypto.RSA.RSA object.
    N(R/R0R1R(tload_key_bioR*(R1R*R(((Rtload_keyscCs=ti|iƒ|ƒ}|djotƒnt|dƒS(sÁ
    Load an RSA key pair from an M2Crypto.BIO.BIO object.

    @type bio: M2Crypto.BIO.BIO
    @param bio: M2Crypto.BIO.BIO object containing RSA key pair in PEM
    format.

    @type callback: Python callable
    @param callback: A Python callable object that is invoked
    to acquire a passphrase with which to unlock the key.
    The default is util.passphrase_callback.

    @rtype: M2Crypto.RSA.RSA
    @return: M2Crypto.RSA.RSA object.
    iN(	Rtrsa_read_keyR(R)R*RR&RUR(R(R*R((RRb$s

cCsti|ƒ}t||ƒS(s–
    Load an RSA key pair from a string.

    @type string: string
    @param string: String containing RSA key pair in PEM format.

    @type callback: Python callable
    @param callback: A Python callable object that is invoked
    to acquire a passphrase with which to unlock the key.
    The default is util.passphrase_callback.

    @rtype: M2Crypto.RSA.RSA
    @return: M2Crypto.RSA.RSA object.
    N(R/R3tstringR(RbR*(ReR*R(((Rtload_key_string:scCsti|ƒ}t|ƒS(sÖ
    Load an RSA public key from file.

    @type file: string
    @param file: Name of file containing RSA public key in PEM format.

    @rtype: M2Crypto.RSA.RSA_pub
    @return: M2Crypto.RSA.RSA_pub object.
    N(R/R0R1R(tload_pub_key_bio(R1R(((Rtload_pub_keyMs	cCs:ti|iƒƒ}|djotƒnt|dƒS(s
    Load an RSA public key from an M2Crypto.BIO.BIO object.

    @type bio: M2Crypto.BIO.BIO
    @param bio: M2Crypto.BIO.BIO object containing RSA public key in PEM
    format.

    @rtype: M2Crypto.RSA.RSA_pub
    @return: M2Crypto.RSA.RSA_pub object.
    iN(Rtrsa_read_pub_keyR(R)RR&RURM(R(R((RRg[s


cCsE|\}}tiƒ}ti||ƒti||ƒt|dƒS(sÿ
    Instantiate an RSA_pub object from an (e, n) tuple.

    @type e: string
    @param e: The RSA public exponent; it is a string in OpenSSL's MPINT 
    format - 4-byte big-endian bit-count followed by the appropriate 
    number of bits.

    @type n: string
    @param n: The RSA composite of primes; it is a string in OpenSSL's MPINT 
    format - 4-byte big-endian bit-count followed by the appropriate 
    number of bits.

    @rtype: M2Crypto.RSA.RSA_pub
    @return: M2Crypto.RSA.RSA_pub object.
    iN(RRRtrsa_newRt	rsa_set_et	rsa_set_nRM(t.0RRR((Rtnew_pub_keyls
(RHtsysRJR/tErrRt	ExceptionRtrsa_initt
no_paddingt
pkcs1_paddingtsslv23_paddingtpkcs1_oaep_paddingRRMRUtstdoutR^RaRKRcRbRfRhRgRn(RcRgRtR/RURMR^RRbRpRnRhRuRsRJRRfRoRaRRv((Rt?s&	$
				¾				

Anon7 - 2021