OSTree.GpgVerifyResult

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object OSTree.GpgVerifyResult OSTree.GpgVerifyResult GObject.Object->OSTree.GpgVerifyResult Gio.Initable->OSTree.GpgVerifyResult

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

describe_variant (variant, output_buffer, line_prefix, flags)

count_all ()

count_valid ()

describe (signature_index, output_buffer, line_prefix, flags)

get (signature_index, attrs)

get_all (signature_index)

lookup (key_id)

require_valid_signature ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class OSTree.GpgVerifyResult(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

classmethod describe_variant(variant, output_buffer, line_prefix, flags)
Parameters:

Similar to OSTree.GpgVerifyResult.describe() but takes a GLib.Variant of all attributes for a GPG signature instead of an OSTree.GpgVerifyResult and signature index.

The variant MUST have been created by OSTree.GpgVerifyResult.get_all().

count_all()
Returns:

signature count

Return type:

int

Counts all the signatures in self.

count_valid()
Returns:

valid signature count

Return type:

int

Counts only the valid signatures in self.

describe(signature_index, output_buffer, line_prefix, flags)
Parameters:

Appends a brief, human-readable description of the GPG signature at signature_index in self to the output_buffer. The description spans multiple lines. A line_prefix string, if given, will precede each line of the description.

The flags argument is reserved for future variations to the description format. Currently must be 0.

It is a programmer error to request an invalid signature_index. Use OSTree.GpgVerifyResult.count_all() to find the number of signatures in self.

get(signature_index, attrs)
Parameters:
  • signature_index (int) – which signature to get attributes from

  • attrs ([OSTree.GpgSignatureAttr]) – Array of requested attributes

Returns:

a new, floating, GLib.Variant tuple

Return type:

GLib.Variant

Builds a GLib.Variant tuple of requested attributes for the GPG signature at signature_index in self. See the OSTree.GpgSignatureAttr description for the GLib.VariantType of each available attribute.

It is a programmer error to request an invalid OSTree.GpgSignatureAttr or an invalid signature_index. Use OSTree.GpgVerifyResult.count_all() to find the number of signatures in self.

get_all(signature_index)
Parameters:

signature_index (int) – which signature to get attributes from

Returns:

a new, floating, GLib.Variant tuple

Return type:

GLib.Variant

Builds a GLib.Variant tuple of all available attributes for the GPG signature at signature_index in self.

The child values in the returned GLib.Variant tuple are ordered to match the OSTree.GpgSignatureAttr enumeration, which means the enum values can be used as index values in functions like g_variant_get_child(). See the OSTree.GpgSignatureAttr description for the GLib.VariantType of each available attribute.

The OSTree.GpgSignatureAttr enumeration may be extended in the future with new attributes, which would affect the GLib.Variant tuple returned by this function. While the position and type of current child values in the GLib.Variant tuple will not change, to avoid backward-compatibility issues please do not depend on the tuple’s overall size or type signature.

It is a programmer error to request an invalid signature_index. Use OSTree.GpgVerifyResult.count_all() to find the number of signatures in self.

lookup(key_id)
Parameters:

key_id (str) – a GPG key ID or fingerprint

Returns:

True on success, False on failure

out_signature_index:

return location for the index of the signature signed by key_id, or None

Return type:

(bool, out_signature_index: int)

Searches self for a signature signed by key_id. If a match is found, the function returns True and sets out_signature_index so that further signature details can be obtained through OSTree.GpgVerifyResult.get(). If no match is found, the function returns False and leaves out_signature_index unchanged.

require_valid_signature()
Raises:

GLib.Error

Returns:

True if self was not None and had at least one signature from trusted keyring, otherwise False

Return type:

bool

Checks if the result contains at least one signature from the trusted keyring. You can call this function immediately after OSTree.Repo.verify_summary() or OSTree.Repo.verify_commit_ext() - it will handle the None self and filled error too.

New in version 2016.6.