| 1 |
/* |
| 2 |
* gnome-keyring |
| 3 |
* |
| 4 |
* Copyright (C) 2008 Stefan Walter |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU Lesser General Public License as |
| 8 |
* published by the Free Software Foundation; either version 2.1 of |
| 9 |
* the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, but |
| 12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Lesser General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Lesser General Public |
| 17 |
* License along with this program; if not, see |
| 18 |
* <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef GKM_SEXP_H_ |
| 22 |
#define GKM_SEXP_H_ |
| 23 |
|
| 24 |
#include <gcrypt.h> |
| 25 |
|
| 26 |
#include <glib-object.h> |
| 27 |
|
| 28 |
#include "gkm-types.h" |
| 29 |
|
| 30 |
GkmSexp* gkm_sexp_new (gcry_sexp_t sexp); |
| 31 |
|
| 32 |
GkmSexp* gkm_sexp_ref (GkmSexp *sexp); |
| 33 |
|
| 34 |
void gkm_sexp_unref (gpointer sexp); |
| 35 |
|
| 36 |
gcry_sexp_t gkm_sexp_get (GkmSexp *sexp); |
| 37 |
|
| 38 |
#define GKM_BOXED_SEXP (gkm_sexp_boxed_type ()) |
| 39 |
|
| 40 |
GType gkm_sexp_boxed_type (void); |
| 41 |
|
| 42 |
|
| 43 |
gboolean gkm_sexp_parse_key (gcry_sexp_t sexp, |
| 44 |
int *algorithm, |
| 45 |
gboolean *is_private, |
| 46 |
gcry_sexp_t *numbers); |
| 47 |
|
| 48 |
gboolean gkm_sexp_key_to_public (gcry_sexp_t sexp, |
| 49 |
gcry_sexp_t *pub); |
| 50 |
|
| 51 |
gboolean gkm_sexp_extract_mpi (gcry_sexp_t sexp, |
| 52 |
gcry_mpi_t *mpi, |
| 53 |
...) G_GNUC_NULL_TERMINATED; |
| 54 |
|
| 55 |
gboolean gkm_sexp_extract_string (gcry_sexp_t sexp, |
| 56 |
gchar **buf, |
| 57 |
...) G_GNUC_NULL_TERMINATED; |
| 58 |
|
| 59 |
gboolean gkm_sexp_extract_buffer (gcry_sexp_t sexp, |
| 60 |
gchar **buf, |
| 61 |
gsize *bufsize, |
| 62 |
...) G_GNUC_NULL_TERMINATED; |
| 63 |
|
| 64 |
gcry_sexp_t gkm_sexp_get_childv (gcry_sexp_t sexp, |
| 65 |
va_list va); |
| 66 |
|
| 67 |
void gkm_sexp_dump (gcry_sexp_t sexp); |
| 68 |
|
| 69 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GkmSexp, gkm_sexp_unref) |
| 70 |
|
| 71 |
#endif /* GKM_SEXP_H_ */ |