CPE2_2 class

class cpe.cpe2_2.CPE2_2(cpe_str, *args, **kwargs)

Implementation of version 2.2 of CPE specification.

A CPE Name is a percent-encoded URI with each name starting with the prefix (the URI scheme name) ‘cpe:’.

Each platform can be broken down into many distinct parts. A CPE Name specifies a simple part and is used to identify any platform that matches the description of that part.

The distinct parts are:

  • Hardware part: the physical platform supporting the IT system.
  • Operating system part: the operating system controls and manages the IT hardware.
  • Application part: software systems, services, servers, and packages installed on the system.

CPE Name syntax:

cpe:/{part}:{vendor}:{product}:{version}:{update}:{edition}:{language}
__len__()

Returns the number of components of CPE Name.

Returns:count of components of CPE Name
Return type:int
static __new__(cls, cpe_str, *args, **kwargs)

Create a new CPE Name of version 2.2.

Parameters:cpe_str (string) – CPE Name string
Returns:CPE object of version 2.2 of CPE specification.
Return type:CPE2_2
as_wfn()

Returns the CPE Name as WFN string of version 2.3. Only shows the first seven components.

Returns:CPE Name as WFN string
Return type:string
Exception:TypeError - incompatible version
get_attribute_values(att_name)

Returns the values of attribute “att_name” of CPE Name. By default a only element in each part.

Parameters:att_name (string) – Attribute name to get
Returns:List of attribute values
Return type:list
Exception:ValueError - invalid attribute name