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.
part of #329
This PR add support for supporting BSI:2.0 sbom new fields such as signature. It supports external and internal signature verification.
For the external signature verification:
$ go run main.go compliance --bsi-v2 samples/signature-test-data/SPDXJSONExample-v2.3.spdx.json --sig samples/signature-test-data/sbom.sig --pub samples/signature-test-data/public_key.pem
You can also confirm the verification process via
openssl
tool too:$ openssl dgst -sha256 -verify samples/signature-test-data/public_key.pem -signature samples/signature-test-data/sbom.sig samples/signature-test-data/SPDXJSONExample-v2.3.spdx.json
For the internal signature verification:
$ go run main.go compliance --bsi-v2 samples/signature-test-data/stree-cdxgen-signed-sbom.cdx.json
NOTE: In this case, just for cross verification, for now, we are writing signature(file name default:
extracted_signature.bin
, public key(file name default:extracted_public_key.pem
) and standalone sbom(filename default:standalone_sbom.json
) in the local directory, so that one can cross verify it viaopenssl
tool also, like:$ openssl dgst -sha256 -verify extracted_public_key.pem -signature extracted_signature.bin standalone_sbom.json
This
stree-cdxgen-signed-sbom.cdx.json
SBOM contains signature and public key. So, sbomqs internally extract the signature and public key into a file, as well as also extract the standalone SBOM by removing signature section and then verifies it.