libp11 icon indicating copy to clipboard operation
libp11 copied to clipboard

Build a static pkcs11 engine library

Open maroueneboubakri opened this issue 1 year ago • 5 comments

Hello,

Has anyone succeeded to build a static pkcs11 library ? Despite that engine are designed to be dynamically loaded, but programmatically we still can set and register an engine in my application which would be statically linked against OpenSSL library and PKCS11 engine and would be great if the build system supports it, or maybe it is supported, but how to generate it.

Best Maro

maroueneboubakri avatar Oct 22 '24 13:10 maroueneboubakri

@mtrojnar FYI

maroueneboubakri avatar Oct 22 '24 13:10 maroueneboubakri

With --disable-shared --enable-static pkcs11 library is not generate for Linux host, while for MinGW it is generating a static pkcs11.a library.

maroueneboubakri avatar Oct 22 '24 13:10 maroueneboubakri

How do you intend to use a static OpenSSL engine?

mtrojnar avatar Oct 22 '24 13:10 mtrojnar

How do you intend to use a static OpenSSL engine?

Using ENGINE_add() to add a new engine to OpenSSL's internal list. The engine front has bind_helper() that can be exported an used to create the engine.

Best Maro

maroueneboubakri avatar Oct 22 '24 14:10 maroueneboubakri

I admit I have zero experience with using static engines with OpenSSL. Feel free to submit a PR to add support for that.

mtrojnar avatar Oct 22 '24 16:10 mtrojnar