
CPE(Common Platform Enumeration 2.3)용 Go 라이브러리
A Go library for CPE(A Common Platform Enumeration 2.3)
go-cpe는 NIST IR 7695 및 7696에 설명된 CPE 명명(Naming) 및 매칭(Matching) 알고리즘의 구현입니다.
참고용 Java 구현은 https://cpe.mitre.org/specification/CPE_Reference_Implementation_Sep2011.zipx 를 참조하십시오.
설치는 일반적인 go get으로 수행할 수 있습니다:
$ go get github.com/knqyf263/go-cpe/...
예제를 참조하세요.
package main
import (
"fmt"
"github.com/knqyf263/go-cpe/matching"
"github.com/knqyf263/go-cpe/naming"
)
func main() {
wfn, err := naming.UnbindURI("cpe:/a:microsoft:internet_explorer%01%01%01%01:8%02:beta")
if err != nil {
fmt.Println(err)
return
}
wfn2, err := naming.UnbindFS(`cpe:2.3:a:microsoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*`)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(matching.IsDisjoint(wfn, wfn2))
fmt.Println(matching.IsEqual(wfn, wfn2))
fmt.Println(matching.IsSubset(wfn, wfn2))
fmt.Println(matching.IsSuperset(wfn, wfn2))
}
go get github.com/knqyf263/go-cpeMIT
Teppei Fukuda