예제 #1
0
 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
예제 #2
0
 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