Commit 214b271
src/Makefile.am: Build static PKCS#11 engine library (libpkcs11.a)
As discussed in issue #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 <[email protected]>1 parent 155455a commit 214b271
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments