libp11

PKCS#11 wrapper library for accessing hardware security tokens and smart cards in C

brewmacoslinux
Try with needOr install directly
Source

About

PKCS#11 wrapper library in C

Examples

load and test a smart card or hardware token$ pkcs11-tool --module /usr/local/lib/libp11.so --list-slots
sign a document with a private key stored on a smart card$ pkcs11-tool --module /usr/local/lib/libp11.so --sign --input-file document.txt --output-file signature.sig
list all certificates on a connected hardware security module$ pkcs11-tool --module /usr/local/lib/libp11.so --list-objects --type cert
use smart card with OpenSSL for cryptographic operations$ openssl engine dynamic -pre SO_PATH:/usr/local/lib/libp11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD
generate a new key pair on a smart card device$ pkcs11-tool --module /usr/local/lib/libp11.so --keypairgen --key-type RSA:2048