IPackageController interface
The API is defined in the header file sysroot-*-kos/include/component/package_manager/i_package_control.h
from the KasperskyOS SDK.
The API lets you do the following:
- Install a KPA package in a KasperskyOS-based solution and remove the KPA package.
- Receive information about an installed KPA package: unique ID, data from the KPA package manifest, and the KPA package status (installed or removed).
Information about API functions is provided in the table below.
Installing a KPA package
To install a KPA package, call the InstallPackage()
function. Using the pkgInfo
input parameter, this function receives data to verify the certificates of an installed KPA package in the InstallPackageInfo
structure. All fields of this structure are optional.
If the signatureVerify
parameter is set to true
(verify certificates of the installed KPA package) but the file names are not specified, the following default values will be used during installation of the KPA package: <package_name>.kcat
for the KPA package external signature file and <package_name>.kidx
for the KPA package index file.
Deleting a KPA package
To remove a KPA package, call the UninstallPackage()
function.
Getting information about installed KPA packages
To get the unique IDs of installed KPA packages, call the ListInstalledPackages()
function. Using the pkgUIDs
output parameter, the function returns a list of unique IDs of installed packages.
To get data on the KPA package manifest, call the GetManifest()
function. Using the manifest
output parameter, the function returns the pointer of the instance of the IPackageManifest
interface that can be used to access the KPA package manifest key values. For more details, refer to IPackageManifest interface.
Notifications about the statuses of KPA packages in a KasperskyOS-based solution
The PackageManager component implements a mechanism for notifications about the statuses of KPA packages in a KasperskyOS-based solution, thereby enabling you to track changes to their statuses. To receive notifications, you must create a notification queue by using the CreateEventQueue()
function.
To extract notifications from this queue, you must use the GetEvents()
function. Using the pkgEvents
output parameter, the function returns the status of KPA packages (since the moment when the queue was created) in the PackageEvent
structure.
To delete the notification queue, call the DestroyEventQueue()
function.
i_package_control.h functions
Function |
Information about the function |
---|---|
|
Purpose Installs a KPA package. Parameters
Returned values If successful, the function returns |
|
Purpose Removes a KPA package. Parameters
Returned values If successful, the function returns |
|
Purpose Gets the unique IDs of installed KPA packages. Parameters
Returned values If successful, the function returns |
|
Purpose Gets the pointer to the instance of the Parameters
Returned values If successful, the function returns |
|
Purpose Gets the checksum of the KPA package component file from the PackageManager component database. Parameters
Returned values If successful, the function returns |
|
Purpose Gets the contents of a KPA package component. Parameters
Returned values If successful, the function returns |
|
Purpose Creates a queue for notifications about the statuses of KPA packages. Parameters
Returned values If successful, the function returns |
|
Purpose Deletes the queue for notifications about the statuses of KPA packages. Parameters
Returned values If successful, the function returns |
|
Purpose Gets the statuses of KPA packages from the notification queue. Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp