OSTree.GpgVerifyResult¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class OSTree.GpgVerifyResult(**kwargs)¶
- Bases:
- 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 descriptionflags (
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
().
- count_valid()¶
- Returns:
valid signature count
- Return type:
Counts only the valid signatures in self.
- describe(signature_index, output_buffer, line_prefix, flags)¶
- Parameters:
signature_index (
int
) – which signature to describeoutput_buffer (
GLib.String
) – aGLib.String
to hold the descriptionflags (
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.
- get(signature_index, attrs)¶
- Parameters:
signature_index (
int
) – which signature to get attributes fromattrs ([
OSTree.GpgSignatureAttr
]) – Array of requested attributes
- Returns:
a new, floating,
GLib.Variant
tuple- Return 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.
- get_all(signature_index)¶
- Parameters:
signature_index (
int
) – which signature to get attributes from- Returns:
a new, floating,
GLib.Variant
tuple- Return type:
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 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:
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:
- Returns:
True
if self was notNone
and had at least one signature from trusted keyring, otherwiseFalse
- Return type:
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.