Class CpeIdentifier
java.lang.Object
org.owasp.dependencycheck.dependency.naming.CpeIdentifier
- All Implemented Interfaces:
Serializable, Comparable<Identifier>, Identifier
A CPE Identifier for a dependency object.
- Author:
- Jeremy Long
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCpeIdentifier(String vendor, String product, String version, Confidence confidence) Constructs a new CPE Identifier from a CPE object with the given confidence.CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, String url, Confidence confidence) Constructs a new CPE Identifier from a CPE object with the given confidence.CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, Confidence confidence) Constructs a new CPE Identifier from a CPE object with the given confidence. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NonNull Identifier o) booleanGet the value of confidence.us.springett.parsers.cpe.CpegetCpe()Returns the CPE object.getNotes()Get the value of notes from suppression notes.getUrl()Get the value of URL.getValue()Get the string representation of the Identifier.inthashCode()static StringnvdProductSearchUrlFor(us.springett.parsers.cpe.Cpe cpe) Produces an NVD search URL for a given CPE to find all applicable vulnerabilities, including only the part, vendor, and product of the given CPE (if populated).static StringnvdSearchUrlFor(String vendor, String product, String version) Produces an NVD search URL for a given application vendor/product/version combination to find all applicable vulnerabilities.static StringnvdSearchUrlFor(us.springett.parsers.cpe.Cpe cpe) Produces an NVD search URL for a given CPE to find all applicable vulnerabilities, including all populated parts of the given CPE.voidsetConfidence(Confidence confidence) Set the value of confidence.voidSet the value of notes.voidSet the value of URL.toString()Returns the CPE 2.3 formatted string.
-
Constructor Details
-
CpeIdentifier
Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
cpe- the CPE valueconfidence- the confidence in the identifiers match
-
CpeIdentifier
Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
cpe- the CPE valueurl- the URL for the identifierconfidence- the confidence in the identifiers match
-
CpeIdentifier
public CpeIdentifier(String vendor, String product, String version, Confidence confidence) throws us.springett.parsers.cpe.exceptions.CpeValidationException Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
vendor- the vendorproduct- the product nameversion- the versionconfidence- the confidence in the identifiers match- Throws:
us.springett.parsers.cpe.exceptions.CpeValidationException- thrown if there is an error converting the vendor, product, and version into a CPE object
-
-
Method Details
-
getCpe
public us.springett.parsers.cpe.Cpe getCpe()Returns the CPE object.- Returns:
- the CPE object
-
getConfidence
Description copied from interface:IdentifierGet the value of confidence.- Specified by:
getConfidencein interfaceIdentifier- Returns:
- the value of confidence
-
getNotes
Description copied from interface:IdentifierGet the value of notes from suppression notes.- Specified by:
getNotesin interfaceIdentifier- Returns:
- the value of notes
-
getUrl
Description copied from interface:IdentifierGet the value of URL.- Specified by:
getUrlin interfaceIdentifier- Returns:
- the value of URL
-
setConfidence
Set the value of confidence.- Specified by:
setConfidencein interfaceIdentifier- Parameters:
confidence- the value of confidence
-
setUrl
Set the value of URL.- Specified by:
setUrlin interfaceIdentifier- Parameters:
url- the value of URL
-
setNotes
Description copied from interface:IdentifierSet the value of notes.- Specified by:
setNotesin interfaceIdentifier- Parameters:
notes- new value of notes
-
getValue
Description copied from interface:IdentifierGet the string representation of the Identifier.- Specified by:
getValuein interfaceIdentifier- Returns:
- the value of notes
-
toString
-
hashCode
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Identifier>
-
nvdSearchUrlFor
Produces an NVD search URL for a given CPE to find all applicable vulnerabilities, including all populated parts of the given CPE. The opened link should be sorted in descending order (sortDirection=2) by publish date (sortOrder=3). -
nvdSearchUrlFor
public static String nvdSearchUrlFor(String vendor, String product, String version) throws us.springett.parsers.cpe.exceptions.CpeValidationException Produces an NVD search URL for a given application vendor/product/version combination to find all applicable vulnerabilities. The opened link should be sorted in descending order (sortDirection=2) by publish date (sortOrder=3).- Throws:
us.springett.parsers.cpe.exceptions.CpeValidationException
-
nvdProductSearchUrlFor
Produces an NVD search URL for a given CPE to find all applicable vulnerabilities, including only the part, vendor, and product of the given CPE (if populated). Discards all other parts/discriminators of the CPE in the generated search. The opened link should be sorted in descending order (sortDirection=2) by publish date (sortOrder=3).
-