File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
cve_bin_tool/sbom_manager Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
11
11
class SWIDParser :
12
+ """
13
+ Class responsible for parsing SWID (Software Identification Tags) XML BOM (Bill of Materials) files.
14
+ """
15
+
12
16
def __init__ (self , validate : bool = True ):
13
17
self .validate = validate
14
18
@@ -35,6 +39,13 @@ def parse(self, sbom_file: str) -> list[list[str]]:
35
39
return modules
36
40
37
41
def extract (self , swid : str ) -> list [str ]:
42
+ """
43
+ Extracts the product name and version from a SWID entry.
44
+ args:
45
+ swid: SWID entry
46
+ returns:
47
+ list containing product name and version
48
+ """
38
49
# Return parsed swid entry as [product, version] list item
39
50
# Format of swid is "URI: <vendor>-<product>-<version>"
40
51
item = swid [swid .find (":" ) + 1 :].split ("-" )
You can’t perform that action at this time.
0 commit comments