PKCS11 is an industry-standard and generic cryptography interface. Instead of libSPDM supporting multiple bindings to cryptography libraries it could have a single PKCS11 layer that then binds to the underlying cryptography libraries.
One possible way is to plug-in pkcs11 instead of replacing crytolib directly.
We can let libspdm->cryptlib->pkcs11. e.g. create cryptlib_pkcs11
If anyone implements a pkcs11 lib, then this pkcs11 lib can be plug in.
People still prefers to keep cryptlib interface here, because it is simpler than pkcs11.
PKCS11 is an industry-standard and generic cryptography interface. Instead of libSPDM supporting multiple bindings to cryptography libraries it could have a single PKCS11 layer that then binds to the underlying cryptography libraries.
e.g. opensource implementation: https://github.com/tpm2-software/tpm2-pkcs11
One possible way is to plug-in pkcs11 instead of replacing crytolib directly. We can let libspdm->cryptlib->pkcs11. e.g. create cryptlib_pkcs11 If anyone implements a pkcs11 lib, then this pkcs11 lib can be plug in. People still prefers to keep cryptlib interface here, because it is simpler than pkcs11.