Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/Makefile.am: Build static PKCS#11 engine library (libpkcs11.a)
As discussed in issue OpenSC#551, an application may statically link against the OpenSSL library. Consequently, using a dynamically loadable engine may present challenges. This PR proposes modifying the build system to enable the creation of a static PKCS11 engine library instead (libpkcs11.a). The library exposes the `bind_engine()` function, which allows the application to load and register the engine directly within the application: extern int bind_engine(ENGINE *e, const char *id); Below is a sample code snippet demonstrating how to load and register the engine: ENGINE *e = NULL; e = ENGINE_new(); if (e == NULL) { error("Error creating new engine instance: %s\n", ERR_reason_error_string(ERR_get_error())); return 0; } /* Bind the engine using the bind_engine function */ if (!bind_engine(e, "pkcs11")) { error("Error binding pkcs11 engine: %s\n", ERR_reason_error_string(ERR_get_error())); ENGINE_free(e); return 0; } Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com>
- Loading branch information