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: - variant (
GLib.Variant
) – aGLib.Variant
fromOSTree.GpgVerifyResult.get_all
() - output_buffer (
GLib.String
) – aGLib.String
to hold the description - line_prefix (
str
orNone
) – optional line prefix string - flags (
OSTree.GpgSignatureFormatFlags
) – flags to adjust the description format
Similar to
OSTree.GpgVerifyResult.describe
() but takes aGLib.Variant
of all attributes for a GPG signature instead of anOSTree.GpgVerifyResult
and signature index.The variant MUST have been created by
OSTree.GpgVerifyResult.get_all
().- variant (
-
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: - signature_index (
int
) – which signature to describe - output_buffer (
GLib.String
) – aGLib.String
to hold the description - line_prefix (
str
orNone
) – optional line prefix string - flags (
OSTree.GpgSignatureFormatFlags
) – flags to adjust the description format
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.- signature_index (
-
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
tupleReturn type: Builds a
GLib.Variant
tuple of requested attributes for the GPG signature at signature_index in self. See theOSTree.GpgSignatureAttr
description for theGLib.VariantType
of each available attribute.It is a programmer error to request an invalid
OSTree.GpgSignatureAttr
or an invalid signature_index. UseOSTree.GpgVerifyResult.count_all
() to find the number of signatures in self.- signature_index (
-
get_all
(signature_index)¶ Parameters: signature_index ( int
) – which signature to get attributes fromReturns: a new, floating, GLib.Variant
tupleReturn 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 theOSTree.GpgSignatureAttr
enumeration, which means the enum values can be used as index values in functions like g_variant_get_child(). See theOSTree.GpgSignatureAttr
description for theGLib.VariantType
of each available attribute.The
OSTree.GpgSignatureAttr
enumeration may be extended in the future with new attributes, which would affect theGLib.Variant
tuple returned by this function. While the position and type of current child values in theGLib.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 fingerprintReturns: True
on success,False
on failureout_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 throughOSTree.GpgVerifyResult.get
(). If no match is found, the function returnsFalse
and leaves out_signature_index unchanged.
-
require_valid_signature
()¶ Raises: GLib.Error
Returns: True
if self was notNone
and had at least one signature from trusted keyring, otherwiseFalse
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
() orOSTree.Repo.verify_commit_ext
() - it will handle theNone
self and filled error too.New in version 2016.6.
-
classmethod