Hackfut Security File Manager
Current Path:
/usr/lib64/python2.6/site-packages/M2Crypto
usr
/
lib64
/
python2.6
/
site-packages
/
M2Crypto
/
📁
..
📄
ASN1.py
(5.48 KB)
📄
ASN1.pyc
(9.24 KB)
📄
ASN1.pyo
(8.85 KB)
📄
AuthCookie.py
(3.01 KB)
📄
AuthCookie.pyc
(5.21 KB)
📄
AuthCookie.pyo
(5.15 KB)
📄
BIO.py
(7.22 KB)
📄
BIO.pyc
(11.9 KB)
📄
BIO.pyo
(11.9 KB)
📄
BN.py
(1.3 KB)
📄
BN.pyc
(1.83 KB)
📄
BN.pyo
(1.83 KB)
📄
DH.py
(2.32 KB)
📄
DH.pyc
(4.57 KB)
📄
DH.pyo
(4.15 KB)
📄
DSA.py
(13.69 KB)
📄
DSA.pyc
(17.02 KB)
📄
DSA.pyo
(16.45 KB)
📄
EC.py
(10.66 KB)
📄
EC.pyc
(12.98 KB)
📄
EC.pyo
(12.39 KB)
📄
EVP.py
(11.53 KB)
📄
EVP.pyc
(16.25 KB)
📄
EVP.pyo
(16.25 KB)
📄
Engine.py
(3.32 KB)
📄
Engine.pyc
(5.36 KB)
📄
Engine.pyo
(5.36 KB)
📄
Err.py
(1.1 KB)
📄
Err.pyc
(2.62 KB)
📄
Err.pyo
(2.62 KB)
📁
PGP
📄
RC4.py
(692 B)
📄
RC4.pyc
(1.6 KB)
📄
RC4.pyo
(1.6 KB)
📄
RSA.py
(12.82 KB)
📄
RSA.pyc
(16.99 KB)
📄
RSA.pyo
(16.59 KB)
📄
Rand.py
(488 B)
📄
Rand.pyc
(583 B)
📄
Rand.pyo
(583 B)
📄
SMIME.py
(7.3 KB)
📄
SMIME.pyc
(10.7 KB)
📄
SMIME.pyo
(10.42 KB)
📁
SSL
📄
X509.py
(33.83 KB)
📄
X509.pyc
(46.16 KB)
📄
X509.pyo
(43.86 KB)
📄
__init__.py
(1.39 KB)
📄
__init__.pyc
(1.93 KB)
📄
__init__.pyo
(1.93 KB)
📄
__m2crypto.so
(434.63 KB)
📄
callback.py
(249 B)
📄
callback.pyc
(475 B)
📄
callback.pyo
(475 B)
📄
ftpslib.py
(2.81 KB)
📄
ftpslib.pyc
(3.85 KB)
📄
ftpslib.pyo
(3.85 KB)
📄
httpslib.py
(7.68 KB)
📄
httpslib.pyc
(7.61 KB)
📄
httpslib.pyo
(7.52 KB)
📄
m2.py
(785 B)
📄
m2.pyc
(963 B)
📄
m2.pyo
(963 B)
📄
m2urllib.py
(2.07 KB)
📄
m2urllib.pyc
(2.13 KB)
📄
m2urllib.pyo
(2.13 KB)
📄
m2urllib2.py
(5.15 KB)
📄
m2urllib2.pyc
(5 KB)
📄
m2urllib2.pyo
(4.95 KB)
📄
m2xmlrpclib.py
(1.88 KB)
📄
m2xmlrpclib.pyc
(2.26 KB)
📄
m2xmlrpclib.pyo
(2.26 KB)
📄
threading.py
(347 B)
📄
threading.pyc
(789 B)
📄
threading.pyo
(789 B)
📄
util.py
(1.55 KB)
📄
util.pyc
(3.01 KB)
📄
util.pyo
(3.01 KB)
Editing: Engine.py
# vim: sts=4 sw=4 et """ M2Crypto wrapper for OpenSSL ENGINE API. Pavel Shramov IMEC MSU """ from M2Crypto import m2, EVP, X509, Err class EngineError(Exception): pass m2.engine_init(EngineError) class Engine: """Wrapper for ENGINE object.""" m2_engine_free = m2.engine_free def __init__(self, id = None, _ptr = None, _pyfree = 1): """Create new Engine from ENGINE pointer or obtain by id""" if not _ptr and not id: raise ValueError("No engine id specified") self._ptr = _ptr if not self._ptr: self._ptr = m2.engine_by_id(id) if not self._ptr: raise ValueError("Unknown engine: %s" % id) self._pyfree = _pyfree def __del__(self): if getattr(self, '_pyfree', 0): self.m2_engine_free(self._ptr) def ctrl_cmd_string(self, cmd, arg, optional = 0): """Call ENGINE_ctrl_cmd_string""" if not m2.engine_ctrl_cmd_string(self._ptr, cmd, arg, optional): raise EngineError(Err.get_error()) def get_name(self): """Return engine name""" return m2.engine_get_name(self._ptr) def get_id(self): """Return engine id""" return m2.engine_get_id(self._ptr) def set_default(self, methods = m2.ENGINE_METHOD_ALL): """Use this engine as default for methods specified in argument Possible values are bitwise OR of m2.ENGINE_METHOD_*""" return m2.engine_set_default(self._ptr, methods) def _engine_load_key(self, func, name, pin = None): """Helper function for loading keys""" ui = m2.ui_openssl() cbd = m2.engine_pkcs11_data_new(pin) try: kptr = func(self._ptr, name, ui, cbd) if not kptr: raise EngineError(Err.get_error()) key = EVP.PKey(kptr, _pyfree = 1) finally: m2.engine_pkcs11_data_free(cbd) return key def load_private_key(self, name, pin = None): """Load private key with engine methods (e.g from smartcard). If pin is not set it will be asked """ return self._engine_load_key(m2.engine_load_private_key, name, pin) def load_public_key(self, name, pin = None): """Load public key with engine methods (e.g from smartcard).""" return self._engine_load_key(m2.engine_load_public_key, name, pin) def load_certificate(self, name): """Load certificate from engine (e.g from smartcard). NOTE: This function may be not implemented by engine!""" cptr = m2.engine_load_certificate(self._ptr, name) if not cptr: raise EngineError("Certificate or card not found") return X509.X509(cptr, _pyfree = 1) def load_dynamic_engine(id, sopath): """Load and return dymanic engine from sopath and assign id to it""" m2.engine_load_dynamic() e = Engine('dynamic') e.ctrl_cmd_string("SO_PATH", sopath) e.ctrl_cmd_string("ID", id) e.ctrl_cmd_string("LIST_ADD", "1") e.ctrl_cmd_string("LOAD", None) return e def load_dynamic(): """Load dynamic engine""" m2.engine_load_dynamic() def load_openssl(): """Load openssl engine""" m2.engine_load_openssl() def cleanup(): """If you load any engines, you need to clean up after your application is finished with the engines.""" m2.engine_cleanup()
Upload File
Create Folder