Librepo library  1.18.1
C library for downloading linux repository metadata and packages
gpg.h
1 /* librepo - A library providing (libcURL like) API to downloading repository
2  * Copyright (C) 2012 Tomas Mlcoch
3  * Copyright (C) 2022 Jaroslav Rohel <jrohel@redhat.com>
4  *
5  * Licensed under the GNU Lesser General Public License Version 2.1
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef __LR_GPG_H__
23 #define __LR_GPG_H__
24 
25 #include <glib.h>
26 
27 G_BEGIN_DECLS
28 
36 typedef struct tLrGpgSubkey LrGpgSubkey;
37 
40 typedef struct tLrGpgKey LrGpgKey;
41 
51 gboolean
52 lr_gpg_check_signature_fd(int signature_fd,
53  int data_fd,
54  const char *home_dir,
55  GError **err);
56 
66 gboolean
67 lr_gpg_check_signature(const char *signature_fn,
68  const char *data_fn,
69  const char *home_dir,
70  GError **err);
71 
72 
82 gboolean
83 lr_gpg_import_key_from_memory(const char *key,
84  size_t key_len,
85  const char *home_dir,
86  GError **err);
87 
96 gboolean
97 lr_gpg_import_key_from_fd(int key_fd,
98  const char *home_dir,
99  GError **err);
100 
109 gboolean
110 lr_gpg_import_key(const char *key_fn,
111  const char *home_dir,
112  GError **err);
113 
114 
124 LrGpgKey *
125 lr_gpg_list_keys(gboolean export_keys,
126  const char *home_dir,
127  GError **err);
128 
133 const LrGpgKey *
134 lr_gpg_key_get_next(const LrGpgKey *key);
135 
140 char * const *
141 lr_gpg_key_get_userids(const LrGpgKey *key);
142 
147 const char *
148 lr_gpg_key_get_raw_key(const LrGpgKey *key);
149 
154 const LrGpgSubkey *
155 lr_gpg_key_get_subkeys(const LrGpgKey *key);
156 
160 void
161 lr_gpg_keys_free(LrGpgKey *key_array);
162 
167 const LrGpgSubkey *
168 lr_gpg_subkey_get_next(const LrGpgSubkey *subkey);
169 
174 const char *
175 lr_gpg_subkey_get_id(const LrGpgSubkey *subkey);
176 
181 const char *
183 
188 long int
190 
195 gboolean
197 
200 G_END_DECLS
201 
202 #endif
const LrGpgSubkey * lr_gpg_subkey_get_next(const LrGpgSubkey *subkey)
gboolean lr_gpg_import_key(const char *key_fn, const char *home_dir, GError **err)
const char * lr_gpg_subkey_get_id(const LrGpgSubkey *subkey)
const char * lr_gpg_subkey_get_fingerprint(const LrGpgSubkey *subkey)
gboolean lr_gpg_check_signature_fd(int signature_fd, int data_fd, const char *home_dir, GError **err)
char *const * lr_gpg_key_get_userids(const LrGpgKey *key)
gboolean lr_gpg_subkey_get_can_sign(const LrGpgSubkey *subkey)
const char * lr_gpg_key_get_raw_key(const LrGpgKey *key)
long int lr_gpg_subkey_get_timestamp(const LrGpgSubkey *subkey)
const LrGpgKey * lr_gpg_key_get_next(const LrGpgKey *key)
const LrGpgSubkey * lr_gpg_key_get_subkeys(const LrGpgKey *key)
struct tLrGpgSubkey LrGpgSubkey
Definition: gpg.h:36
LrGpgKey * lr_gpg_list_keys(gboolean export_keys, const char *home_dir, GError **err)
void lr_gpg_keys_free(LrGpgKey *key_array)
gboolean lr_gpg_import_key_from_memory(const char *key, size_t key_len, const char *home_dir, GError **err)
gboolean lr_gpg_check_signature(const char *signature_fn, const char *data_fn, const char *home_dir, GError **err)
gboolean lr_gpg_import_key_from_fd(int key_fd, const char *home_dir, GError **err)
struct tLrGpgKey LrGpgKey
Definition: gpg.h:40