DMTF / libspdm

BSD 3-Clause "New" or "Revised" License
116 stars 106 forks source link

Add PKCS11 Support #1

Open jyao1 opened 3 years ago

jyao1 commented 3 years ago

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.

jyao1 commented 3 years ago

Standard reference:

  1. https://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
  2. https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/pkcs11-base-v3.0.html

The header file can be found at: Appendix B. Manifest constants.

We can create a cryptolib_pkcs11.