Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
lib
/
python2.4
/
site-packages
/
M2Crypto
/
Upload File :
New :
File
Dir
//proc/self/root/usr/lib/python2.4/site-packages/M2Crypto/RSA.pyc
mò :PDc�����������@���s��d��Z��d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�e�f�d�„��ƒ��YZ�e�i�e�ƒ�e�i �Z �e�i �Z �e�i�Z�e�i�Z�d�f��d�„��ƒ��YZ �d�e �f�d�„��ƒ��YZ�d�„��Z�e�i�d �„�Z�e�d �„�Z�e�i�d�„�Z�e�i�d�„�Z�e�i�d �„�Z�d�„��Z�d�„��Z�d�„��Z�d�S(���sc���M2Crypto wrapper for OpenSSL RSA API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.Nt���RSAErrorc�����������B���s���t��Z�RS(���N(���t���__name__t ���__module__(����(����(����t0���/usr/lib/python2.4/site-packages/M2Crypto/RSA.pyR�������s����t���RSAc�����������B���sì���t��Z�d��Z�e�i�Z�d�d�„�Z�d�„��Z�d�„��Z�d�„��Z �d�„��Z �d�„��Z�d�„��Z�d �„��Z �d �„��Z�d�e�i�d�„�Z�d�e�i�d �„�Z�e�Z�d�e�i�d�„�Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�d�„�Z�d�d�„�Z�RS(���s��� RSA Key Pair. i����c���������C���s0���t��i�|�ƒ�p �t�d�‚�|�|��_�|�|��_�d��S(���Ns���'rsa' type error(���t���m2t���rsa_type_checkt���rsat���AssertionErrort���selft���_pyfree(���R ���R���R ���(����(����R���t���__init__���s���� c���������C���s+���t��|��d�d�ƒ�o�|��i�|��i�ƒ�n�d��S(���NR ���i����(���t���getattrR ���t���m2_rsa_freeR���(���R ���(����(����R���t���__del__���s����c���������C���s���t��i�|��i�ƒ�d�>S(���Ni���(���R���t���rsa_sizeR ���R���(���R ���(����(����R���t���__len__"���s����c���������C���sL���|�d�j�o�t�i�|��i�ƒ�Sn(�|�d�j�o�t�i�|��i�ƒ�Sn�t�‚�d��S(���Nt���et���n(���t���nameR���t ���rsa_get_eR ���R���t ���rsa_get_nt���AttributeError(���R ���R���(����(����R���t���__getattr__%���s ���� c���������C���s9���|��i�ƒ��p �t�d�‚�t�i�|��i�ƒ�t�i�|��i�ƒ�f�S(���Ns���key is not initialised(���R ���t ���check_keyR���R���R���R���R���(���R ���(����(����R���t���pub-���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���rsa_public_encryptR���t���datat���padding(���R ���R���R���(����(����R���t���public_encrypt1���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���rsa_public_decryptR���R���R���(���R ���R���R���(����(����R���t���public_decrypt5���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���rsa_private_encryptR���R���R���(���R ���R���R���(����(����R���t���private_encrypt9���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���rsa_private_decryptR���R���R���(���R ���R���R���(����(����R���t���private_decrypt=���s����t���aes_128_cbcc���������C���s‰���|�d�j�o �t�i�|��i�|�i�ƒ��|�ƒ�SnY�t �t�|�d�ƒ�}�|�d�j�o�t�d�|�‚�n �|�ƒ��}�t�i�|��i�|�i�ƒ��|�|�ƒ�Sd�S(���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. s���not such cipher %sN( ���t���ciphert���NoneR���t���rsa_write_key_no_cipherR ���R���t���biot���_ptrt���callbackR���t���ciphR����t ���rsa_write_key(���R ���R(���R%���R*���R+���(����(����R���t���save_key_bioA���s����� c���������C���s%���t��i�|�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. t���wbN(���t���BIOt���openfilet���fileR(���R ���R-���R%���R*���(���R ���R1���R%���R*���R(���(����(����R���t���save_key\���s�����c���������C���s)���t��i�ƒ��}�|��i�|�|�|�ƒ�|�i�ƒ��S(���sB��� Returns the key(pair) as a string in PEM format. N(���R/���t���MemoryBufferR(���R ���R-���R%���R*���t���read(���R ���R%���R*���R(���(����(����R���t���as_pemr���s�����c���������C���s���t��i�|��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(���R���t���rsa_write_key_derR ���R���R(���R)���(���R ���R(���(����(����R���t���save_key_der_bioz���s�����c���������C���s���t��i�|�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/���R0���R1���R(���R ���R7���(���R ���R1���R(���(����(����R���t���save_key_derƒ���s�����c���������C���s���t��i�|��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(���R���t���rsa_write_pub_keyR ���R���R(���R)���(���R ���R(���(����(����R���t���save_pub_key_bio���s�����c���������C���s+���t��i�|�d�ƒ�}�t�i�|��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/���R0���R1���R(���R���R9���R ���R���R)���(���R ���R1���R(���(����(����R���t���save_pub_key–���s�����c���������C���s���t��i�|��i�ƒ�S(���N(���R���t ���rsa_check_keyR ���R���(���R ���(����(����R���R��� ���s����t���sha1c���������C���sL���t��t�d�|�d�ƒ�}�|�d�j�o�t�d�|�f�‚�n�t�i�|��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 t���NID_s���unknown algorithmN( ���R���R���t���algoR&���t���digest_typet ���ValueErrort���rsa_signR ���R���t���digest(���R ���RC���R?���R@���(����(����R���t���sign£���s ���� � c���������C���sO���t��t�d�|�d�ƒ�}�|�d�j�o�t�d�|�f�‚�n�t�i�|��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>���s���unknown algorithmN(���R���R���R?���R&���R@���RA���t ���rsa_verifyR ���R���R���t ���signature(���R ���R���RF���R?���R@���(����(����R���t���verify·���s ����� (���R���R���t���__doc__R���t���rsa_freeR ���R���R���R���R���R���R���R���R!���R#���t���utilt���passphrase_callbackR-���R2���t���save_pemR5���R7���R8���R:���R;���R���RD���RG���(����(����(����R���R������s,���� t���RSA_pubc�����������B���sD���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�e�i�Z�e�i �Z �d�„��Z�RS(���s0��� Object interface to an RSA public key. c���������C���s1���|�d�d�g�j�o �t�d�‚�n�|�|��i�|�<d��S(���NR���R���s0���use factory function new_pub_key() to set (e, n)(���R���R����t���valueR ���t���__dict__(���R ���R���RN���(����(����R���t���__setattr__Ö���s���� c���������G���s ���t��d�‚�d��S(���Ns!���RSA_pub object has no private key(���R����(���R ���t���argv(����(����R���R!���Ý���s����c���������G���s ���t��d�‚�d��S(���Ns!���RSA_pub object has no private key(���R����(���R ���RQ���(����(����R���R#���à���s����c���������C���s���t��i�|��i�ƒ�S(���N(���R���t���rsa_check_pub_keyR ���R���(���R ���(����(����R���R���ë���s����(���R���R���RH���RP���R!���R#���R���R;���R2���R:���R-���R���(����(����(����R���RM���Ð���s���� c�����������C���s���t��t�i�t�i�ƒ��ƒ�‚�d��S(���N(���R����R���t���err_reason_error_stringt ���err_get_error(����(����(����R���t ���rsa_errorï���s����c���������C���s1���d�d�d�d�g�}�|�i�|�|��ƒ�|�i�ƒ��d�S(���s)��� Default callback for gen_key(). t���.t���+t���*s��� N(���t���cht���outt���writet���pt���flush(���R\���R���RZ���RY���(����(����R���t���keygen_callbackó���s�����c���������C���s���t��t�i�|��|�|�ƒ�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. i���N(���R���R���t���rsa_generate_keyt���bitsR���R*���(���R`���R���R*���(����(����R���t���gen_keyü���s�����c���������C���s���t��i�|��ƒ�}�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/���R0���R1���R(���t���load_key_bioR*���(���R1���R*���R(���(����(����R���t���load_key��s�����c���������C���s=���t��i�|��i�ƒ��|�ƒ�}�|�d�j�o�t�ƒ��n�t�|�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. i���N( ���R���t���rsa_read_keyR(���R)���R*���R���R&���RU���R���(���R(���R*���R���(����(����R���Rb���$��s ����� c���������C���s���t��i�|��ƒ�}�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/���R3���t���stringR(���Rb���R*���(���Re���R*���R(���(����(����R���t���load_key_string:��s�����c���������C���s���t��i�|��ƒ�}�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/���R0���R1���R(���t���load_pub_key_bio(���R1���R(���(����(����R���t���load_pub_keyM��s���� �c���������C���s:���t��i�|��i�ƒ��ƒ�}�|�d�j�o�t�ƒ��n�t�|�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. i���N(���R���t���rsa_read_pub_keyR(���R)���R���R&���RU���RM���(���R(���R���(����(����R���Rg���[��s ���� � c���������C���sE���|��\�}�}�t�i�ƒ��}�t�i�|�|�ƒ�t�i�|�|�ƒ�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. i���N(���R���R���R���t���rsa_newR���t ���rsa_set_et ���rsa_set_nRM���(���t���.0R���R���R���(����(����R���t���new_pub_keyl��s ����(���RH���t���sysRJ���R/���t���ErrR���t ���ExceptionR����t���rsa_initt ���no_paddingt ���pkcs1_paddingt���sslv23_paddingt���pkcs1_oaep_paddingR���RM���RU���t���stdoutR^���Ra���RK���Rc���Rb���Rf���Rh���Rg���Rn���(���Rc���Rg���Rt���R/���RU���RM���R^���R���Rb���Rp���Rn���Rh���Ru���Rs���RJ���R����Rf���Ro���Ra���R���Rv���(����(����R���t���?���s&��� $ ¾