1 /* signers.c - maintain signer sets
2 * Copyright (C) 2001 Werner Koch (dd9jn)
4 * This file is part of GPGME.
6 * GPGME is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * GPGME is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
30 /* The signers are directly stored in the context.
31 * So this is quite different to a recipient set.
36 gpgme_signers_clear (GpgmeCtx c)
44 for (i=0; i < c->signers_size; i++ ) {
47 gpgme_key_unref (c->signers[i]);
54 gpgme_signers_add (GpgmeCtx c, const GpgmeKey key)
59 return mk_error (Invalid_Value);
64 for (i=0; i < c->signers_size && c->signers[i]; i++ )
66 if ( !(i < c->signers_size) ) {
69 int n = c->signers_size + 5;
71 newarr = xtrycalloc ( n, sizeof *newarr );
73 return mk_error (Out_Of_Core);
74 for (j=0; j < c->signers_size; j++ )
75 newarr[j] = c->signers[j];
85 gpgme_signers_enum (const GpgmeCtx c, int seq )
89 return_null_if_fail (c);
90 return_null_if_fail (seq<0);
94 for (i=0; i < c->signers_size && c->signers[i]; i++ ) {
96 gpgme_key_ref (c->signers[i]);