This example demonstrates how to use the OpenSSL pkcs11-provider API in C to access PKCS#11 tokens and read private/public keys or certificates.
sudo apt-get update
sudo apt-get install -y openssl libssl-dev softhsm2 opensc pkcs11-providercmake .
make./pkcs11-provider-example_test.sh