sbom-model-cyclonedx
cyclonedx adapter for sbom-model.
parses cyclonedx json documents into the format-agnostic Sbom type.
usage
use Sbom;
use CycloneDxReader;
let json = r#"{
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"version": 1,
"components": [
{
"type": "library",
"name": "serde",
"version": "1.0.0",
"purl": "pkg:cargo/serde@1.0.0",
"licenses": [{"license": {"id": "MIT"}}]
}
]
}"#;
let sbom: Sbom = read_json.unwrap;
assert_eq!;
assert_eq!;
supported features
- cyclonedx 1.4+ json format (xml not supported)
- components with name, version, purl, licenses, hashes
- supplier information
- bom-ref based dependency graph
- metadata (timestamps, authors)
error handling
use ;
the Error type wraps parse errors from the underlying cyclonedx-bom crate.
related crates
sbom-model- the core data modelsbom-model-spdx- spdx format adaptersbom-diff- diff engine and cli