PackageManager component
The API is defined in the header files located in the directory sysroot-*-kos/include/component/package_manager/
from the KasperskyOS SDK.
The PackageManager component usage scenario is described in the article titled PackageManager component usage scenario.
The package_manager_proxy.h interface
This API is defined in the header file sysroot-*-kos/include/component/package_manager/kos_ipc/package_manager_proxy.h
from the KasperskyOS SDK.
The interface contains function CreatePackageManager()
for getting the pointer to the instance of the IPackageManager
interface that is required for working with the PackageManager component. Using the cfg
input parameter, this function accepts configuration parameters in the PackageManagerConfig
structure. All fields of this structure are optional.
package_manager_proxy.h functions
Function |
Information about the function |
---|---|
|
Purpose Gets the pointer to the instance of the Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
IPackageManager interface
The API is defined in the header file sysroot-*-kos/include/component/package_manager/i_package_manager.h
from the KasperskyOS SDK.
The IPackageManager
interface lets you receive the pointer to the IPackageController
interface. This interface is intended for installing KPA packages to a KasperskyOS-based solution, and gets information about these packages.
i_package_manager.h functions
Function |
Information about the function |
---|---|
|
Purpose Gets the pointer to an instance of the Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
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
IPackageManifest interface
This API is defined in the header file sysroot-*-kos/include/component/package_manager/i_package_manifest.h
from the KasperskyOS SDK.
The API lets you get the KPA package manifest key values. For more details about the available keys of the KPA package manifest, see "KPA package manifest"
Information about API functions is provided in the table below.
Getting program ID
To get the ID of a program that was installed from a KPA package, call the GetPackageID()
function.
Getting information about KPA package components
To get information about KPA package components, call the GetApplicationsInfo()
function. Using the applications
output parameter, the function returns information about KPA package components as a vector of ApplicationInfo
structures.
An extensions
structure element describes an object in JSON format. ManifestType
is an alias of the nlohmann:json
type.
Getting program startup configurations
To get information about the startup configurations of a program installed from a KPA package, call the GetRunConfigurationsInfo()
function. Using the runConfigurations
output parameter, the function returns information about program startup configurations as a vector of RunConfigurationInfo
structures.
Receiving information about a program
To get information about a program installed from a KPA package, call the GetPackageInfo()
function. Using the packageInfo
output parameter, the function returns information about startup configurations in the PackageInfo
structure.
Getting information about the isolated storage of a program
To get information about the isolated storage of a program, call the GetPrivateStorageInfo()
function. Using the packageInfo
output parameter, the function returns information about startup configurations in the PrivateStorage
structure.
Getting information about objects of an arbitrary format
To get information about objects of an arbitrary format that were added by the KPA package developer (the extensions
key from the KPA package manifest), call the Get()
function.
i_package_manifest.h functions
Function |
Information about the function |
---|---|
|
Purpose Gets the unique ID of a program installed from a KPA package. Parameters
Returned values If successful, the function returns |
|
Purpose Gets information about KPA package components. Parameters
Returned values If successful, the function returns |
|
Purpose Gets information about the startup configurations of a program installed from a KPA package. Parameters
Returned values If successful, the function returns |
|
Purpose Gets information about a program installed from a KPA package. Parameters
Returned values If successful, the function returns |
|
Purpose Gets information about the isolated storage of a program. Parameters
Returned values If successful, the function returns |
|
Purpose Gets information about objects of an arbitrary format that were added to the manifest by the KPA package developer. Parameters N/A Returned values Returns the pointer of an object with the type |
Usage example:
client.cpp