Top |
GPtrArray * | ostree_sign_get_all () |
gboolean | ostree_sign_commit () |
gboolean | ostree_sign_commit_verify () |
gboolean | ostree_sign_data () |
gboolean | ostree_sign_data_verify () |
OstreeSign * | ostree_sign_get_by_name () |
const gchar * | ostree_sign_get_name () |
gboolean | ostree_sign_add_pk () |
gboolean | ostree_sign_clear_keys () |
gboolean | ostree_sign_load_pk () |
const gchar * | ostree_sign_metadata_format () |
const gchar * | ostree_sign_metadata_key () |
gboolean | ostree_sign_set_pk () |
gboolean | ostree_sign_set_sk () |
gboolean | ostree_sign_summary () |
An OstreeSign interface allows to select and use any available engine for signing or verifying the commit object or summary file.
GPtrArray *
ostree_sign_get_all (void
);
Return an array with newly allocated instances of all available signing engines; they will not be initialized.
Since: 2020.2
gboolean ostree_sign_commit (OstreeSign *self
,OstreeRepo *repo
,const gchar *commit_checksum
,GCancellable *cancellable
,GError **error
);
Add a signature to a commit.
Depending of the signing engine used you will need to load the secret key with ostree_sign_set_sk.
self |
an OstreeSign object |
|
repo |
an OsreeRepo object |
|
commit_checksum |
SHA256 of given commit to sign |
|
cancellable |
A GCancellable |
|
error |
a GError |
TRUE
if commit has been signed successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_commit_verify (OstreeSign *self
,OstreeRepo *repo
,const gchar *commit_checksum
,char **out_success_message
,GCancellable *cancellable
,GError **error
);
Verify if commit is signed with known key.
Depending of the signing engine used you will need to load the public key(s) for verification with ostree_sign_set_pk, ostree_sign_add_pk and/or ostree_sign_load_pk.
self |
an OstreeSign object |
|
repo |
an OsreeRepo object |
|
commit_checksum |
SHA256 of given commit to verify |
|
out_success_message |
success message returned by the signing engine. |
[out][nullable][optional] |
cancellable |
A GCancellable |
|
error |
a GError |
TRUE
if commit has been verified successfully,
FALSE
in case of error or no valid keys are available (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_data (OstreeSign *self
,GBytes *data
,GBytes **signature
,GCancellable *cancellable
,GError **error
);
Sign the given data
with pre-loaded secret key.
Depending of the signing engine used you will need to load the secret key with ostree_sign_set_sk.
self |
an OstreeSign object |
|
data |
the raw data to be signed with pre-loaded secret key |
|
signature |
in case of success will contain signature. |
[out] |
cancellable |
A GCancellable |
|
error |
a GError |
TRUE
if data
has been signed successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_data_verify (OstreeSign *self
,GBytes *data
,GVariant *signatures
,char **out_success_message
,GError **error
);
Verify given data against signatures with pre-loaded public keys.
Depending of the signing engine used you will need to load the public key(s) with ostree_sign_set_pk, ostree_sign_add_pk or ostree_sign_load_pk.
self |
an OstreeSign object |
|
data |
the raw data to check |
|
signatures |
the signatures to be checked |
|
out_success_message |
success message returned by the signing engine. |
[out][nullable][optional] |
error |
a GError |
TRUE
if data
has been signed at least with any single valid key,
FALSE
in case of error or no valid keys are available (error
will contain the reason).
Since: 2020.2
OstreeSign * ostree_sign_get_by_name (const gchar *name
,GError **error
);
Create a new instance of a signing engine.
Since: 2020.2
const gchar *
ostree_sign_get_name (OstreeSign *self
);
Return the pointer to the name of currently used/selected signing engine.
Since: 2020.2
gboolean ostree_sign_add_pk (OstreeSign *self
,GVariant *public_key
,GError **error
);
Add the public key for verification. Could be called multiple times for adding all needed keys to be used for verification.
The public_key
argument depends of the particular engine implementation.
TRUE
in case if the key could be added successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_clear_keys (OstreeSign *self
,GError **error
);
Clear all previously preloaded secret and public keys.
Since: 2020.2
gboolean ostree_sign_load_pk (OstreeSign *self
,GVariant *options
,GError **error
);
Load public keys for verification from anywhere. It is expected that all keys would be added to already pre-loaded keys.
The options
argument depends of the particular engine implementation.
For example, ed25515
engine could use following string-formatted options:
filename
-- single file to use to load keys from
basedir
-- directory containing subdirectories
'trusted.ed25519.d' and 'revoked.ed25519.d' with appropriate
public keys. Used for testing and re-definition of system-wide
directories if defaults are not suitable for any reason.
TRUE
in case if at least one key could be load successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
const gchar *
ostree_sign_metadata_format (OstreeSign *self
);
Return the pointer to the string with format used in (detached) metadata for current signing engine.
Since: 2020.2
const gchar *
ostree_sign_metadata_key (OstreeSign *self
);
Return the pointer to the name of the key used in (detached) metadata for current signing engine.
Since: 2020.2
gboolean ostree_sign_set_pk (OstreeSign *self
,GVariant *public_key
,GError **error
);
Set the public key for verification. It is expected what all previously pre-loaded public keys will be dropped.
The public_key
argument depends of the particular engine implementation.
TRUE
in case if the key could be set successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_set_sk (OstreeSign *self
,GVariant *secret_key
,GError **error
);
Set the secret key to be used for signing data, commits and summary.
The secret_key
argument depends of the particular engine implementation.
TRUE
in case if the key could be set successfully,
FALSE
in case of error (error
will contain the reason).
Since: 2020.2
gboolean ostree_sign_summary (OstreeSign *self
,OstreeRepo *repo
,GVariant *keys
,GCancellable *cancellable
,GError **error
);
Add a signature to a summary file. Based on ostree_repo_add_gpg_signature_summary implementation.
self |
Self |
|
repo |
ostree repository |
|
keys |
keys -- GVariant containing keys as GVarints specific to signature type. |
|
cancellable |
A GCancellable |
|
error |
a GError |
Since: 2020.2