Solution
OpenSSL creates a detached signature, so the original .so file remains unchanged and a separate signature file is generated.
-
Sign the shared library with OpenSSL by typing this command: openssl dgst -sha256 -sign private_key.pem \ -out your_library.so.sig your_library.so
-
Verify the signature with OpenSSL by typing this command: openssl dgst -sha256 -verify public_key.pem \ -signature your_library.so.sig your_library.so
If the verification is successful, OpenSSL returns: Verified OK
If the file has been modified or the signature/public key does not match, the verification will fail.
Please note that Linux and applications such as LabVIEW do not automatically verify OpenSSL signatures when loading a .so file. If signature validation is required, your application must explicitly perform the verification before loading the shared library.
For more information, please refer to the OpenSSL documentation.