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.VariantfromOSTree.GpgVerifyResult.get_all()output_buffer (
GLib.String) – aGLib.Stringto hold the descriptionflags (
OSTree.GpgSignatureFormatFlags) – flags to adjust the description format
Similar to
OSTree.GpgVerifyResult.describe() but takes aGLib.Variantof all attributes for a GPG signature instead of anOSTree.GpgVerifyResultand 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.Stringto 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.Varianttuple- Return type:
Builds a
GLib.Varianttuple of requested attributes for the GPG signature at signature_index in self. See theOSTree.GpgSignatureAttrdescription for theGLib.VariantTypeof each available attribute.It is a programmer error to request an invalid
OSTree.GpgSignatureAttror 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.Varianttuple- Return type:
Builds a
GLib.Varianttuple of all available attributes for the GPG signature at signature_index in self.The child values in the returned
GLib.Varianttuple are ordered to match theOSTree.GpgSignatureAttrenumeration, which means the enum values can be used as index values in functions like g_variant_get_child(). See theOSTree.GpgSignatureAttrdescription for theGLib.VariantTypeof each available attribute.The
OSTree.GpgSignatureAttrenumeration may be extended in the future with new attributes, which would affect theGLib.Varianttuple returned by this function. While the position and type of current child values in theGLib.Varianttuple 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:
Trueon success,Falseon 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
Trueand sets out_signature_index so that further signature details can be obtained throughOSTree.GpgVerifyResult.get(). If no match is found, the function returnsFalseand leaves out_signature_index unchanged.
- require_valid_signature()¶
- Raises:
- Returns:
Trueif self was notNoneand 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 theNoneself and filled error too.New in version 2016.6.