engine loading and configuration
"""
from ctypes import c_void_p, c_char_p, c_int
-from ctypescrypto import libcrypto
+from ctypescrypto import libcrypto,pyver
from ctypescrypto.exception import LibCryptoError
__all__ = ['default', 'set_default', 'Engine']
in the token, accessed by engine
"""
def __init__(self, engine_id, **kwargs):
+ if pyver > 2 or isinstance(engine_id, unicode):
+ engine_id = engine_id.encode('utf-8')
eng = libcrypto.ENGINE_by_id(engine_id)
if eng is None:
# Try load engine
libcrypto.ENGINE_ctrl_cmd_string.argtypes = (c_void_p, c_char_p, c_char_p,
c_int)
libcrypto.ENGINE_finish.argtypes = (c_char_p, )
+libcrypto.ENGINE_init.argtypes = (c_void_p, )
+libcrypto.UI_OpenSSL.restype = c_void_p
+libcrypto.ENGINE_load_private_key.argtypes = (c_void_p, c_char_p, c_void_p, c_void_p)
+libcrypto.ENGINE_load_private_key.restype = c_void_p