A Common Platform Enumeration 2.3 implementation for golang.
go get github.com/umisama/go-cpe
Simple example is here:
// Create new item with Setter functions.
item1 := cpe.NewItem(
item1.SetPart(cpe.Application)
item1.SetVendor(cpe.NewStringAttr("microsoft"))
item1.SetProduct(cpe.NewStringAttr("internet_explorer"))
// create new item with WFN. You can use also other formats(url, formatted string and WFN).
item2, err := cpe.NewItemFromWfn(`wfn:[part="a",vendor="microsoft",product="internet_explorer",version="8\.0\.6001",update="beta"]`)
if err != nil {
panic(err)
}
fmt.Println("Vendor :", item2.Vendor()
// Compare functions
fmt.Println("is relation superset between item1 and item2? : ", cpe.CheckSuperset(item1, item2))
fmt.Println("is relation equal between item1 and item2? : ", cpe.CheckEqual(item1, item2))
))
- NIST IR 7695 — Common Platform Enumeration: Naming Specification Version 2.3
- NIST IR 7696 — Common Platform Enumeration: Name Matching Specification Version 2.3
under the MIT License.