YaST2 Developers Documentation: Unknown YCP Module

Unknown YCP Module

This module has an unstable interface.

Imports

  • FileUtils
  • Report
  • String

Global Functions

Local Variables

Local Functions

Info:

File: modules/GPG.ycp Package: yast2 Summary: A wrapper for gpg binary Authors: Ladislav Slezák

$Id$

global Init (string home_dir, boolean force) -> boolean

(Re)initialize the module, the cache is invalidated if the home directory is changed.

Parameters:
home_dir home directory for gpg (location of the keyring)
force unconditionaly clear the key caches
local buildGPGcommand (string options) -> string

Build GPG option string

Parameters:
options additional gpg options
Return value:
gpg option string
local callGPG (string options) -> map

Execute gpg with the specified parameters, --homedir is added to the options

Parameters:
options additional gpg options
Return value:
result of the execution
local parsing_map -> map<string,string>

Map for parsing gpg output. Key is regexp, value is the key returned in the result of the parsing.

local parse_key (list<string> lines) -> map

Parse gpg output using the parsing map

Parameters:
lines gpg output (splitted into lines)
Return value:
parsed output
local parseKeys (string input) -> list<map>

Parse gpg output

Parameters:
input gpg output
Return value:
parsed keys
global PublicKeys () -> list<map>

Return list of the public keys in the keyring.

Return value:
public keys: [ $["fingerprint": string key_fingerprint, "id": string key_ID, "uid": list user_ids], ...]
global PrivateKeys () -> list<map>

Return list of the private keys in the keyring.

Return value:
public keys: [ $["fingerprint": string key_fingerprint, "id": string key_ID, "uid": list user_ids], ...]
global CreateKey () -> boolean

Create a new gpg key. Executes 'gpg --gen-key' in an xterm window (in the QT UI) or in the terminal window (in the ncurses UI).

local SignFile (string keyid, string file, string passphrase, boolean ascii_signature) -> boolean

Sign a file. The ASCII armored signature is stored in file with .asc suffix

Parameters:
keyid id of the signing key
file the file to sign
passphrase passphrase to unlock the private key
ascii_signature if true ASCII armored signature is created (with suffix .asc) otherwise binary signature (with suffix .sig) is created
Return value:
true if the file has been successfuly signed
global SignAsciiDetached (string keyid, string file, string passphrase) -> boolean

Sign a file. The ASCII armored signature is stored in file with .asc suffix

Parameters:
keyid id of the signing key
file the file to sign
passphrase passphrase to unlock the private key
Return value:
true if the file has been successfuly signed
global SignDetached (string keyid, string file, string passphrase) -> boolean

Sign a file. The binary signature is stored in file with .sig suffix

Parameters:
keyid id of the signing key
file the file to sign
passphrase passphrase to unlock the private key
Return value:
true if the file has been successfuly signed
global VerifyFile (string sig_file, string file) -> boolean

Verify a file using a signature file. The key which has been used for signing must be imported in the keyring.

Parameters:
sig_file file with the signature
file file to verify
Return value:
true if the file has been successfuly verified
global ExportAsciiPublicKey (string keyid, string file) -> boolean

Export a public gpg key in ACSII armored file.

Parameters:
keyid id of the key
file the target file
Return value:
true if the file has been successfuly signed
global ExportPublicKey (string keyid, string file) -> boolean

Export a public gpg key in binary format.

Parameters:
keyid id of the key
file the target file
Return value:
true if the file has been successfuly signed