YaST2 Developers Documentation: GPG Key Management

GPG Key Management

modules/KeyManager.ycp
Manages GPG keys in the package manager
  • Ladislav Slezák

This module has an unstable interface.

Imports

  • Directory
  • Report
  • String

Global Functions

Local Functions

global Reset () -> void

Reset the internal state of the module. The current configuration and all changes are deleted.

local ReadCurrentKeys () -> list<map<string,any> >

Read the current configuration from the package manager

Return value:
the current configuration, nil when an error occurr
global Read () -> boolean

Read the current configuration from the package manager. The previous changes are lost (@see Reset). The target system of the package manager must be initialized before reading GPG keys!

Return value:
true on success
global SearchGPGKey (string key_id) -> map<string,any>

Search a GPG key in the known keys

Parameters:
key_id ID of the key
Return value:
Data about the key or nil if the key was not found
global Write () -> boolean

Apply the changes, update the current status

Return value:
true on success
global Modified () -> boolean

Has been something changed?

Return value:
true if something has been changed
global GetKeys () -> list<map<string,any> >

Return the current keys.

Return value:
list of known GPG keys ($[ "id" : string, "name" : string, "trusted" : boolean ])
global DeleteKey (string key_id) -> boolean

Delete the key from the package manager

Parameters:
key_id ID of the key to delete
Return value:
true on success
global ImportFromFile (string file, boolean trusted) -> map<string,any>

Import key from a file

Parameters:
file path to the file
trusted true if the key is trusted
Return value:
map with the key, nil when import fails (invalid key, not existing file, already imported key...)