Add wc_SignCertCb API for external signing implementations #9625
+421
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tied to this PR: wolfSSL/wolfTPM#449
This pull request introduces support for signing X.509 certificates using an external callback, allowing integration with hardware security modules (HSMs), TPMs, or other custom signing implementations. The changes include a new API, its implementation, and corresponding unit tests to ensure proper functionality and error handling.
New external signing support:
wc_SignCertCb_tand the API functionwc_SignCertCbtoasn_public.h, enabling certificate signing via a user-provided callback for external cryptographic devices or custom logic.wc_SignCertCbinasn.c, including handling for both RSA and non-RSA signatures, buffer management, and error cases.Testing and validation:
test_wc_SignCertCbintest_asn.c, including a mock RSA signing callback, certificate generation, signature verification, and error case coverage.